MultiplexingServiceClient is a .NET library designed to optimize and manage multiple connections to Microsoft Dataverse environments. It supports executing various types of requests (CreateMultiple, UpdateMultiple, ExecuteMultiple) in parallel, ensuring efficient use of resources and improved performance.
License
—
Deps
4
Install Size
—
Vulns
✓ 0
Published
Nov 25, 2024
$ dotnet add package Fic.Dataverse.MultiplexingServiceClientThe MultiplexingServiceClient library is designed to handle multiple connections to a Dataverse environment efficiently. It provides functionalities to execute various types of requests using multiple threads and batches, optimizing the connections for better performance.
🔧 Connection Optimization
Automatically optimizes connection settings such as DefaultConnectionLimit, ThreadPool, and ServicePointManager properties.
⚡ Parallel Request Execution
Executes multiple requests in parallel using Parallel.ForEach, supporting ExecuteMultipleRequest, UpdateMultipleRequest, and CreateMultipleRequest.
🔄 Connection Management
Manages ServiceClient instances and provides methods to clone and retrieve service clients.
To install the MultiplexingServiceClient library, add the following NuGet package to your project:
dotnet add package MultiplexingServiceClient
or
Use the NuGet Package Manager in Visual Studio:
MultiplexingServiceClient.To initialize the MultiplexingServiceClient, provide a list of connection strings for your Dataverse environments:
var connectionStrings = new List<string>
{
"your-connection-string-1",
"your-connection-string-2"
};
var client = new MultiplexingServiceClient(connectionStrings);
To execute a CreateMultipleRequest using the MultiplexingServiceClient, follow these steps:
var connectionStrings = new List<string>
{
"your-connection-string-1",
"your-connection-string-2"
};
var client = new MultiplexingServiceClient(connectionStrings);
var createRequest = new CreateMultipleRequest
{
Targets = new EntityCollection(new List<Entity>
{
new Entity("account") { ["name"] = "Account 1" },
new Entity("account") { ["name"] = "Account 2" }
})
};
client.Execute(createRequest, numberOfThreads: 10, batchSize: 2);
This project is licensed under the MIT License. See the LICENSE file for details.
If you find this tool useful and would like to support its development, you can buy me a coffee!
Your support is greatly appreciated!