Skip to content

Question: Specific Columns in Query<TEntity> #545

@rapthi

Description

@rapthi

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

Metadata

Metadata

Assignees

Labels

deployedFeature or bug is deployed at the current releasefixedThe bug, issue, incident has been fixed.questionFurther information is requested

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions