-
Notifications
You must be signed in to change notification settings - Fork 38
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
UseAsDataSource OData expand trows Argument types do not match exception #60
Comments
A PR is welcome. |
Have you considered the OData Extensions library? Or creating your own mapping extensions like the ReadMe examples? |
OData extensions work perfectly! I try to use GetAsync method but it loading all set ignoring PageSize controller option. But GetQueryAsync works as it should. [EnableQuery]
public async Task<IQueryable<TModel>> Get(ODataQueryOptions<TModel> options)
{
return await _context.Set<TEntity>().GetQueryAsync(_mapper, options, HandleNullPropagationOption.False);
} Thank you very much for your help! |
Sounds great. Just FYI |
Thanks for the clarification! I checked the behavior of EnableQuery, in my conditions it works correctly. The TOP is not a hard limit, which can lead to fetching the entire table. But I will take this into account in the future! |
Just so other users get the correct information, do not use the EnableQuery attribute with AutoMapper.Extensions.OData. See the ReadMe documentation and issue #12 at AutoMapper.Extensions.OData. If we're missing a test case, please open an issue at AutoMapper.Extensions.OData. |
It is interesting. I publish project to test environment and collect information for explain reply. It will take some time. |
Hi!
I have simple project that uses odata. I decided to use an automapper because ist very simple. But i have problem with function UseAsDataSource(). When i use ProjectTo() all work fine but EF cannot evaluate filter expressions in db and go it locally. But when i use UseAsDataSource() its throw Argument types do not match exception when specifying $expand. I would like to use the functionality UseAsDataSource() due to performance.
Source/destination types
Mapping configuration
AutoMapper Version: 9.0.0
EF Version: 2.2.6
Expected behavior
Expected list expansion when specifying $expand=positions
Actual behavior
Throws Argument types do not match
Steps to reproduce
I create demonstration project
Best regards. Vitaly
The text was updated successfully, but these errors were encountered: