OData / WebApi

OData Web API: A server library built upon ODataLib and WebApi
https://docs.microsoft.com/odata
Other
855 stars 473 forks source link

PUT against a collection-valued nav prop #1771

Open ashutosh088 opened 5 years ago

ashutosh088 commented 5 years ago

There is a scenario where we need to replace the existing collection of entities (Navigation Property). But looks like it is not supported in WebAPI OData. This is blocking the Likes ingestion to Substrate from Teams and Yammer.

Can you please add the required support as per: http://docs.oasis-open.org/odata/odata/v4.01/cs01/part1-protocol/odata-v4.01-cs01-part1-protocol.html#sec_UpdateaCollectionProperty

Thanks

mikepizzo commented 5 years ago

Note that the above references updating a collection-valued (non-navigation) property (i.e., collections of primitive or complex types).

In V4.01 we added support for similar functionality for a collection-valued navigation property, as per http://docs.oasis-open.org/odata/odata/v4.01/cs01/part1-protocol/odata-v4.01-cs01-part1-protocol.html#sec_ReplaceallReferencesinaCollectionval.

sanonsen commented 5 years ago

PUT on the nav property avoids creating an action in this scenario, which is the better API.

xuzhg commented 5 years ago

1774