We're using query interceptors in ADO.NET Data Services in our application to filter the result set for each entity based on the data that a user has access to. However I'm getting the following exception thrown from one of our query interceptors:
Internal .NET Framework Data Provider error 1004, 0, Related Entities cannot be specified for Entity constructors that are not part of the Query Mapping View for an Entity Set..
Does anyone know when/why this exception is thrown?
To add some context to this post I'm using the following filter criteria in my URL:
$filter=(OnlineItems/Products/ProductId eq 856)
where the query interceptor is:
[QueryInterceptor("OnlineItems")]
public Expression<Func<OnlineItems, bool>> QueryOnlineItems()
{
return item => (item.Products.Any(p => p.Price > 10));
}
As a stab in the dark I would imagine it would be the combination of filtering on Products as well as expanding on Products but I'm not sure how this causes the whole thing to fall over.