How do I update an OData entity and modify its navigation properties in one request?

前端 未结 3 532
花落未央
花落未央 2020-12-31 23:43

I am trying to implement what I thought was a simple scenario using an OData service provided by WCF Data services (using the OData V3 application/json;odata=verbose payload

3条回答
  •  无人及你
    2021-01-01 00:32

    Pratik's comment was the answer (Pratik if you'd like to repost this as an answer, I'll mark it as such - thanks!):

    Question: Do you want to update the category instance or do you want to update some of the properties of the category instance. There is no way to do the later other than batch. For the former, you can do something like: { "Name" : "new name", "Category" : { "__metadata" : { "uri" : "/api.svc/Categories(2)" }}}. Hope this helps. – Pratik

提交回复
热议问题