Batch requests
Often in enterprise applications, large amounts of data needs to be manipulated in batches to increase performance. Batch data processing patterns were observed in Microsoft SQL's evolution (and many other database engines), where batch-SQL executions were introduced to improve efficiency.
In this recipe, we will use the same request collection from the previous recipe to create an account and a contact; however, the execution will be done in a batch request as opposed to a transaction request.
Getting ready
In order to test this code, you will need write access to the account and contact entities, a Visual Studio IDE, and the Dynamics 365 NuGet packages to access the SDK libraries (please refer to the first recipe in this chapter for details on how to set up your Visual Studio solution).
How to do it...
- Create a new console application in Visual Studio called
Packt.Xrm.Batch
. - Right-click on
References
and click onManage NuGet Packages,
and search and installMicrosoft.CrmSdk.XrmTooling...