I\'ve got a simple WebApi method like this decorated with the OData queryable attribute.
[Queryable]
public virtual IQueryable Get()
There is a better solution. Try this:
public virtual IQueryable Get(ODataQueryOptions query)
{
var people = query.ApplyTo(uow.Person().GetAll());
return ConvertToDtos(people);
}
This will make sure the query runs on Person instead of PersonDTO. If you want the conversion to happen through an attribute instead of in code, you'll still want to implement an action filter similar to what you put up.