1

我刚刚从 BreezeJS 1.1 升级到 1.4 但是“扩展”似乎不起作用?我可以看到我的扩展进入服务器:

http://localhost:60198/api/Data/App?$filter=Id%20eq%209&$expand=Household%2CHousehold%2FPrimary

我可以看到数据回来了:

[
  {
    "$id": "1",
    "$type": "App.Models.Base.App, App",
    "Id": 9,
    "Number": "ZZZZ",
    "Name": "ZZZZZ",
    "Household": {
      "$id": "2",
      "$type": "App.Models.Base.Household, App",
      "Id": 6,
      "Primary": {
        "$id": "3",
        "$type": "App.Models.Base.Person, App",
        "Id": 9,
        "FirstName": "ZZZZ",
        "MiddleName": "ZZZZ",
        "LastName": "ZZZ",
      }
    },
    "HouseholdId": 6
  }
]

但是当我尝试访问它时,家庭财产为空。这曾经适用于 1.1。

breeze.EntityQuery
    .from("App")
    .where("id", "==", id)
    .expand("Household, Household.Primary")

如果记录为 json 变成

query {"resourceName":"App","entityType":null,"wherePredicate":{"_filterQueryOp":{"_$typeName":"FilterQueryOp","name":"Equals"},"_propertyOrExpr":"id","_value":9,"_valueIsLiteral":false},"orderByClause":null,"selectClause":null,"skipCount":null,"takeCount":null,"expandClause":{"propertyPaths":["Household","Household.Primary"]},"parameters":{},"inlineCountEnabled":false,"entityManager":null} 

更新:我降级到 1.2.5 并且它再次工作。我在代码中四处查看,它看起来像这里的检查: https://github.com/IdeaBlade/Breeze/blob/master/Breeze.Client/Scripts/breeze.debug.js#L13312 返回 false,因此实体没有被更新?谁知道我对微风代码库很陌生。

4

1 回答 1

0

导航属性设置不正确。

于 2013-08-18T02:19:26.437 回答