1对1单向父子导航属性的Breezejs 1.5.4和1.5.5 LinkedRelatedEntities引发异常

1对1单向父子导航属性的Breezejs 1.5.4和1.5.5 LinkedRelatedEntities引发异常,breeze,Breeze,有这种关系的 Parent Entity Id ChildNavigationProperty Child Entity Id // P-Key and F-Key to parent Entity Breeze执行proto.\u linkRelatedEntities功能时,链接父实体的相关实体 它正在这样做: if (np.isScalar) { // n -> 1 eg: child: OrderDetail parent: P

有这种关系的

Parent Entity
    Id
    ChildNavigationProperty    

Child Entity      
   Id // P-Key and F-Key to parent Entity
Breeze执行
proto.\u linkRelatedEntities
功能时,链接父实体的相关实体

它正在这样做:

if (np.isScalar) {
   // n -> 1  eg: child: OrderDetail parent: Product
   // 1 -> 1 eg child: Employee parent: Employee 
   // ( only Manager, no DirectReports property)
   childToParentNp = np;
   unattachedChildren.forEach(function (child) {
       child.setProperty(childToParentNp.name, entity);
   });
}
这会引发异常,因为它尝试在子实体而不是父实体上查找
ChildNavigationProperty
<代码>此[propertyName]=值其中“this”是“子实体”,“propertyName”是“ChildNavigationProperty”,“value”是“父实体”

在Breeze v1.5.3中,执行以下操作:

entity.setProperty(parentToChildNp.name, unattachedChildren[0]);
对我来说,这看起来更正确,是我有雾吗