Can't the breeze expand multiple navigation paths?

if I run the following query using NorthindModel, NorthwindDataContext from breeze samples, only the first navigation property expands. All other return values:

var query = EntityQuery.from("OrderDetails") .where("OrderID", "==", 11069) .expand("Order.Customer", "Order.Employee"); manager.executeQuery(query).then(querySucceeded).fail(queryFailed); function querySucceeded(data){ var customer = data.results[0].Order().Customer(); var employee = data.results[0].Order().Employee(); // returns null!!!!! } 

If I change the order in the list of forwarding options than with the client, it will be set to null:

  var query = EntityQuery.from("OrderDetails") .where("OrderID", "==", 11069) .expand("Order.Employee", "Order.Customer"); manager.executeQuery(query).then(querySucceeded).fail(queryFailed); function querySucceeded(data){ var customer = data.results[0].Order().Customer(); // returns null!!!!! var employee = data.results[0].Order().Employee(); } 

What is the problem?

+8
breeze
source share
1 answer

The expand method takes one argument, which is either an array or a comma-delimited string. You gave him two arguments. So try the following.

var query = EntityQuery.from ("OrderDetails") .where ("OrderID", "==", 11069) .expand (["Order.Customer", "Order.Emputer"]);

Pay attention to [].

+10
source share

All Articles