Update resources through navigation properties possible?

白昼怎懂夜的黑 提交于 2019-12-11 09:08:38

问题


I have a resource A that has a navigation property that points to resource B. The schema looks like this:

Resource A:

  • ID
  • B (this is a one-to-many navigation property)

Resource B:

  • ID
  • Property1
  • Property2

Can I update values of resource B (i.e. update property1 and property2 of B) through the navigation link of A? In other words, can I say A.B[5].Property1 = x?

In the OData spec and examples, I only see descriptions of modifying which instance of B is associated with A (i.e. modifying /A(0)/$links/B), but not whether or not I can do a PUT/MERGE to /A(0)/B(2) and modify B itself.


回答1:


You should be able to send a PUT request to /A(0)/B(2) and modify properties of B.



来源:https://stackoverflow.com/questions/6092105/update-resources-through-navigation-properties-possible

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!