我的OData模型包含一对具有多对多关系的实体(Parents-Children)。我正在尝试将子实体添加到父级的Children导航属性,但之后调用saveChanges()根本没有任何效果。代码看起来像:
// both 'parent' and 'child' are attached to the context
// both have their navigation properties empty
parent.Children.push(child);
context.saveChanges();
我也尝试过:
parent.Children = parent.Children.concat([child]);
parent.Children = [child];
但无济于事,它仍然无效 - saveChanges()调用不会向服务发出任何请求,就好像没有任何要更新的内容一样。
我真的很感激如何使用JayData处理多对多关系的示例,以及一些帮助处理上述问题的示例。 感谢