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

Question: Specific Columns in Query<TEntity> #545

Closed
rapthi opened this issue Sep 4, 2020 · 3 comments
Closed

Question: Specific Columns in Query<TEntity> #545

rapthi opened this issue Sep 4, 2020 · 3 comments
Assignees
Labels
deployed Feature or bug is deployed at the current release fixed The bug, issue, incident has been fixed. question Further information is requested

Comments

@rapthi
Copy link

rapthi commented Sep 4, 2020

Hello,

In a DbRepository, I am trying to get a specific column. Here is the code :

public class PersonRepository : DbRepository<SqlConnection>, IPersonRepository
{
        public PersonRepository() 
            : base(ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString)
        { }

        public string GetName(int personId) 
        {
                var field = Field.Parse<Person>(e => new
               {
                     e.Name,
               });
               return Query<Person>(f => f.PersonId == personId, fields: field).FirstOrDefault();
        }
}

The "fields" param is not implemented apparently... But how can I achieve this?

Sorry, but the documentation didn't really help me for that...

Thanks for your help

@mikependon
Copy link
Owner

Thanks for reading the documentation, we tried to update it to the latest code we had. Anyway, it is implemented on the latest beta releases for the upcoming version v1.12.0. This is just newly released!

Would you be able to install the version RepoDb v1.12.0-beta2?

> Install-Package RepoDb -version 1.12.0-beta2

I would highly recommend to as well use the newly released beta package for the other DB provider libraries (i.e: RepoDb.SqlServer, RepoDb.SqlServer.BulkOperations, etc).

@mikependon mikependon changed the title Specific Columns in Query<TEntity> Question: Specific Columns in Query<TEntity> Sep 4, 2020
@rapthi
Copy link
Author

rapthi commented Sep 4, 2020

Thanks for your fast reply.

Updating the NuGet did the trick! Thank you so much!

@mikependon mikependon self-assigned this Sep 6, 2020
@mikependon mikependon added the question Further information is requested label Sep 6, 2020
@mikependon mikependon added deployed Feature or bug is deployed at the current release fixed The bug, issue, incident has been fixed. labels Sep 17, 2020
@mikependon
Copy link
Owner

Hey @rapthi, we are closing this ticket for now. Please do let us know if there are any more problems. Thanks

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 fixed The bug, issue, incident has been fixed. question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants