Breeze / breeze-client

Breeze for JavaScript clients
MIT License
38 stars 16 forks source link

The first expression of this AnyAllPredicate must be a nonscalar Navigation PropertyExpression #51

Closed ganySA closed 3 years ago

ganySA commented 3 years ago

Hi

I have written a breeze query which queries along a related entity.

var p1= Predicate.create("email", FilterQueryOp.Contains, query);
var p2= Predicate.create("client", FilterQueryOp.Any, p1);

The query string being sent to the server is as follows {"where":{"Client":{"any":{"Email":{"contains":"mike"}}}},"orderBy":["Date desc"],"expand":["Client"],"skip":0,"take":10,"inlineCount":true}:

The server seems to .net server seems to panic on this and return: The first expression of this AnyAllPredicate must be a nonscalar Navigation PropertyExpression

I have followed the docs and this seems to be a valid query. Is this a bug?

steveschmitt commented 3 years ago

What is the parent entity for the resource endpoint? According to your query, and the error message, it should be an entity that has many Client entities associated to it, with a property such as

ICollection<Client> Client { get; set; }
ganySA commented 3 years ago

Thanks this led me to the answer. Closing.