c# - Mapping IQueryable where clause from DTO to Entity -


i've got odata webapi method follows:

        // get: odata/employees     [enablequery]     public iqueryable<dtos.employee> getemployees()     {         return this.attemptoperation(context =>              {                 iqueryable<dtos.employee> employees                     = context.employees.project().to<dtos.employee>();                 return employees;             });     } 

it returns data to service if don't specify filter. add $filter=employeeid eq '1' url exception.

the exception aws dynamodb context library use performing linq queries against dynamodb. however, indicating context doesn't have table dtos.employee.

this of course obvious, context has entities, not dtos.

how can iqueryable clause specified client translate proper entity type?

for example, client needs query against dtos.employee.employeeid , needs translate clause against entities.employee.employeeid.


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -