如果我使用NorthindModel运行以下查询,那么来自breeze示例的NorthwindDataContext只会显示第一个导航属性.所有其他返回null:
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!!!!! }
如果我更改扩展参数列表中的顺序,而不是将customer设置为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(); }
这有什么问题?