AutoMapper / AutoMapper.Extensions.OData

Creates LINQ expressions from ODataQueryOptions and executes the query.
MIT License
140 stars 39 forks source link

It is possible to pass as a parameter or parameterize the class "ODataQuerySettings"? #43

Closed jeangatto closed 4 years ago

jeangatto commented 4 years ago

The code below works, however I need to return the DTO and not the POCO entities:

var queryable = this._context.Cities.AsNoTracking().AsQueryable(); var total = queryable.Count(); var results = queryOptions.ApplyTo(queryable, new ODataQuerySettings() { PageSize = pageSize });

When I use the AutoMapper.Extensions.OData library, ODataQuerySettings is not supported var result = await queryable.GetQueryAsync<CityDTO>(this._mapper, queryOptions);

Any suggestion? Hugs!

BlaiseD commented 4 years ago

The OData repository or StackOverflow will probably be more helpful.

We help with bugs/questions about AutoMapper.Extensions.OData - as you've pointed out the API does not support ODataQuerySettings.