Unfortunately it does not provide a sample code (in C#) for how to compose the batch request and handle respective response.
So here is the one that I have built for my project:
The SendBatchRequestAsync method has two overloads which can be used for two different scenarios:
- Execute a batch request that is composed of a list of individual requests, each of them can be in turn a change set, or
- Execute a list of requests that are grouped into a single change set.
Example 1:
Example 2:
Utility method to create HttpMessageContent:
Really appreciate your efforts. Well done.
ReplyDeleteThanks. Glad you find it helpful.
DeleteI have also created a working code at https://github.com/thucnguyen77/dynamics-365-web-api-batch-request-example.
ReplyDeleteThank you very much. you save my time :)
ReplyDeleteDoes this allows multiple files to be uploaded using the batch requests?
ReplyDelete