I have an ASP.NET Web API application using Entity Framework and Odata.
I would like to change the query results when using GET ... currently inside the controller, you just simply pass EntityFramework data entities back to Odata handlers ...
[EnableQuery] public IQueryable<myEntity> GetLineItem() { return db.myEntities; }
It’s easier to add any query that Odata goes into this by simply returning a subset
return db.myEntity.Where(myEntity => myEntity.Name == "Bob")
Odata will add everything in the querystring $ filter parameter to the expression passed here, and you will get a subset of these results.
However, I would like to repeat the results after executing the query and the SQL results are processed in entity objects.
I tried to create a wrapper that implements the IQueryable interface and connects to GetEnumerator methods, and the same goes for IProvider and connects to the execute method. It seems that Odata does not use any of them.
Is there any way to do this?
source share