Search code examples
c#odata

how to insert an array of items using the Insert operation (POST) in an OData service?


I have two SQL Tables Movies and Reviews and they form a one-to-many relationship. I have created an OData service based on these two tables and I would like to know how can I create/insert multiple reviews (an array) for the same movie at the same time, without calling the insert method over and over again (no looping)?

Can anyone drop a tip or two or some sample code?


Solution

  • You can use either OData operations (more specifically OData actions) or OData batch processing.

    Also check the upcoming OData 4.0 drafts.

    If you need sample code you're going to have to state which OData server implementation you're using. If it's custom, then only you can answer your question (although you may ask other lower-level questions about more specific subjects).