Request: /api/person?$filter=Name eq 'John'Server method: return repo.GetAll().Select(o => Mapper.Map<PersonDTO>(o));Above request, results in an error like "Where with predicate after a projection is not supported". Other OData queries for #top / $skip / $orderby work fine.However I think in this case the query generated by Mongo C# driver is incorrect. That is it should apply the filter first and then project and not the other way around.Any leads in resolving this is much appreciated. I am using C# driver 1.7 & OData 5.2.0-rc1.Thanks ...
That is a limitation in the current implementation of Linq. We are working to correct that with this ticket:https://jira.mongodb.org/browse/CSHARP-601.
However, I'd encourage you to figure out what you are actually attempting to do. Projecting prior to a filter could mean you are filtering on computed expressions, such as adding 2 columns together. MongoDB queries do not support this type of behavior, which is why this is currently disallowed by our linq provider. Aggregation framework allows this to a point, but there are a different set of limitations imposed by the Aggregation framework.