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

Mapping does not work when querying data #68

Open
ElenaShlykova opened this issue Aug 15, 2020 · 2 comments
Open

Mapping does not work when querying data #68

ElenaShlykova opened this issue Aug 15, 2020 · 2 comments
Assignees

Comments

@ElenaShlykova
Copy link

I have such mapping:

DapperPlusManager.Entity<TestEntity>()
               .Key(x => x.Id, "ID")
               .Map(x => x.Name, "TestName")
               .Output(x => x.Id)
               .Table(TableName);

When I save data with BulkInsert it works, but when I query data the "Name" property is empty.

   public class TestEntity
   {
      public int Id { get; set; }

      public string Name { get; set; }
   }

         using (var connection = SessionFactory.OpenConnection())
         {
            return connection.Query<T>("select * from TestEntity").ToList();
         }

Is there a way to get this to work correctly?

@JonathanMagnan JonathanMagnan self-assigned this Aug 16, 2020
@JonathanMagnan
Copy link
Member

Hello @ElenaShlykova ,

The mapping currently only works for method coming from Dapper Plus such as BulkInsert, BulkUpdate, BulkDelete, BulkMerge.

Query method is from Dapper itself so we do not have any control over it.

However, we will look if there is something we can do here this week such as providing additional helper/method if the Query is coming from the DapperPlusContext.

@JonathanMagnan
Copy link
Member

Hello @ElenaShlykova ,

This is eventually something we will want to do in the future.

Unfortunately, we choose to pause temporarily this request as we need to complete the code re-write of our primary library for EF Core 5 which is coming.

We will let this issue open since as we said, that's definitely something we will want to add to our library

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants