Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Support to Enumerable Scalar Values #538

Closed
mikependon opened this issue Sep 2, 2020 · 2 comments
Closed

Feature: Support to Enumerable Scalar Values #538

mikependon opened this issue Sep 2, 2020 · 2 comments
Assignees
Labels
deployed Feature or bug is deployed at the current release enhancement New feature or request feature Defined as a big development item (feature) fixed The bug, issue, incident has been fixed. priority Top priority feature or things to do todo Things to be done in the future

Comments

@mikependon
Copy link
Owner

Currently, RepoDB requires a concreate .NET CLR Type return type just to retrieve the results from the fetch operations (i.e: ExecuteQuery, Query, QueryAll and BatchQuery).

Let us say, you only would like to query all the product name from the [dbo].[Product] table (like below).

using (var connection = new SqlConnection(connectionString))
{
	var result = connection.ExecuteQuery<ProductNameOnly>("SELECT Name [dbo].[Product] ORDER BY Name;");
}

You are required to create a concrete class ProductNameOnly.

public class ProductNameOnly
{
	public string Name { get; set; }
}

This is quite too extensive in the client side (or the library consumer) just to create this un-organized class.

This user story will allow the developers to do the magic query of the targetted Scalar (column-based) values. The propose call would be below.

String:

using (var connection = new SqlConnection(connectionString))
{
	var result = connection.ExecuteQuery<string>("SELECT Name [dbo].[Product] ORDER BY Name;");
}

Long/Int:

using (var connection = new SqlConnection(connectionString))
{
	var result = connection.ExecuteQuery<long>("SELECT Id [dbo].[Order] ORDER BY Id;");
}

In which the result is of type IEnumerable<Type>.

@mikependon mikependon added enhancement New feature or request todo Things to be done in the future priority Top priority feature or things to do feature Defined as a big development item (feature) labels Sep 2, 2020
@mikependon mikependon self-assigned this Sep 2, 2020
@mikependon mikependon pinned this issue Sep 5, 2020
mikependon added a commit that referenced this issue Sep 6, 2020
Automatic Conversion / Integration Tests / Compiler Updates #538
mikependon added a commit that referenced this issue Sep 6, 2020
Supported the Typed Result for Enum (String/NonString). #538
@mikependon mikependon added the fixed The bug, issue, incident has been fixed. label Sep 6, 2020
@mikependon mikependon unpinned this issue Sep 6, 2020
@mikependon
Copy link
Owner Author

The fix is available at version RepoDb v1.12.0-beta3 or above.

@mikependon mikependon added the deployed Feature or bug is deployed at the current release label Sep 6, 2020
mikependon added a commit that referenced this issue Sep 8, 2020
@mikependon
Copy link
Owner Author

Closing this ticket now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployed Feature or bug is deployed at the current release enhancement New feature or request feature Defined as a big development item (feature) fixed The bug, issue, incident has been fixed. priority Top priority feature or things to do todo Things to be done in the future
Projects
None yet
Development

No branches or pull requests

1 participant