You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue was raised in 2015, and the same limitation seems still exist in the Odata.ApplyTo(). I am wondering is there a better solution than You can do this to check for a $select wrapper, get a Dictionary of key,values and then map it your model. at this moment?
Similar to the original question, I am trying to perform in memory filtering of a query, after it has been retrieved from the downstream API, and before returning it to the client.
Using ODataQueryOptions.ApplyTo(...) I can let OData do all it's query magic on the in-memory data. However if $expand or $select has been supplied, the returned IQueryable contains not the entities themselves, but SelectExpandWrapper objects. Which it is impossible to extract the original entity from.
Ideally I would like to be able to do something like this in a controller action
public IQueryable<Entity> GetFeed(ODataQueryOptions<Entity> opts)
{
IQueryable<Entity> result = opts.ApplyTo(<IEnumerable>.AsQueryable<Entity>())
foreach (var item in result)
{
// perform extra filtering here
}
return result;
}
Expected result
Any suggestions will be very helpful.
The text was updated successfully, but these errors were encountered:
I want to follow up on this very old ticket: #521
This issue was raised in 2015, and the same limitation seems still exist in the Odata.ApplyTo(). I am wondering is there a better solution than
You can do this to check for a $select wrapper, get a Dictionary of key,values and then map it your model.
at this moment?Similar to the original question, I am trying to perform in memory filtering of a query, after it has been retrieved from the downstream API, and before returning it to the client.
Using ODataQueryOptions.ApplyTo(...) I can let OData do all it's query magic on the in-memory data. However if $expand or $select has been supplied, the returned IQueryable contains not the entities themselves, but SelectExpandWrapper objects. Which it is impossible to extract the original entity from.
Ideally I would like to be able to do something like this in a controller action
Expected result
Any suggestions will be very helpful.
The text was updated successfully, but these errors were encountered: