DevPack4Dataverse 0.0.0.3-beta
dotnet add package DevPack4Dataverse --version 0.0.0.3-beta
NuGet\Install-Package DevPack4Dataverse -Version 0.0.0.3-beta
<PackageReference Include="DevPack4Dataverse" Version="0.0.0.3-beta" />
paket add DevPack4Dataverse --version 0.0.0.3-beta
#r "nuget: DevPack4Dataverse, 0.0.0.3-beta"
// Install DevPack4Dataverse as a Cake Addin
#addin nuget:?package=DevPack4Dataverse&version=0.0.0.3-beta&prerelease
// Install DevPack4Dataverse as a Cake Tool
#tool nuget:?package=DevPack4Dataverse&version=0.0.0.3-beta&prerelease
DevPack4Dataverse
DevPack4Dataverse aka DevPack For Dataverse is a set of instructions built on top of the SDK for Dataverse. Designed with the idea of optimizing and speeding up work with external communication with Dataverse API.
License
Features
graph TB
A[DataverseDevPack]
B[ExecuteMultiple]
C[FieldDrill]
D[SdkProxy]
E[CreateLinqExpressionBuilder]
A --> |Can use ExecuteMultiple.CreateRequestBuilder|B
A --> C
A --> D
A --> E
E --> |LINQ expressions as param|A
C --> D
B --> D
ExecuteMultiple
Gives ability to quickly call dataverse endpoint with optimized packs of requests, multiple connections will be used to multiply speed and skip request per minute limits. In example bellow you can see how you can build unlimited in size requests that later will be sent to datavserse endpoint in packs.
Entity[] recordsInCrm = dataverseDevPack.SdkProxy.RetrieveMultiple(new QueryExpression
{
EntityName = EntityName,
ColumnSet = new ColumnSet(false)
});
ExecuteMultipleRequestBuilder executeMultipleRequestBuilder = dataverseDevPack.ExecuteMultiple
.CreateRequestBuilder();
foreach (var item in recordsInCrm)
{
executeMultipleRequestBuilder.AddDelete(item.ToEntityReference());
}
AdvancedExecuteMultipleRequestsStatistics executeStatistic = await dataverseDevPack.ExecuteMultiple
.Execute(executeMultipleRequestBuilder,
new ExecuteMultipleRequestSettings
{
ErrorReport = (OrganizationRequest obj, string error) => Console.WriteLine($"Error: {error}"),
ReportProgress = (int cur, int max) => Console.Title = $"Progress[{cur}/{max}]",
ReportProgressInterval = TimeSpan.FromMilliseconds(100)
});
FieldDrill
Gives ability to go down by lookup fields simply by defining path as string with specified delimiter or by providing path as array of fields.
For example when we have lookup that points to record X, we can call FieldDrill with these parameters
await dataverseDevPack.FieldDrill.RetreiveAsync<string>(item.ToEntityReference(), "ownerid.fullname");
It will retrieve field fullname from lookup named ownerid in starting record entity reference.
SdkProxy
Gives ability to quickly execute any type of request to dataverse endpoint.
CreateLinqExpressionBuilder
Gives ability to build expression that later can be used in Where method of early or late bound in OrganizationServiceContext class. In this example we'll try to retrieve 100 records by name. Maximum limit of expressions is 500, it's hard limit specified by SDK.
ILinqExpressionBuilder<Entity> builder = connectionManager.CreateLinqExpressionBuilder<Entity>();
foreach (string item in Enumerable.Range(1, 100).Select(p => $"Name {p}"))
{
builder.AddOr(p => p["xx_name"] == item);
}
Expression<Func<Entity, bool>> finalExpression = builder.Result;
serviceContext.xxSet.Where(finalExpression).ToArray();
Roadmap
- Add model to model mapper for integration
- QueryBuilder for faster and better requests / also for LINQ
- LINQ support
- and more...
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net7.0
- Ardalis.GuardClauses (>= 4.0.1)
- Microsoft.PowerPlatform.Dataverse.Client (>= 1.0.26)
- Microsoft.PowerPlatform.Dataverse.Client.Dynamics (>= 1.0.26)
- System.Linq.Async (>= 6.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
0.0.0.3-beta | 926 | 12/1/2022 |
0.0.0.2-beta | 128 | 11/27/2022 |
0.0.0.1-beta | 96 | 11/27/2022 |
Added statistics
Added connection picking based on statistics
Added async GetConnection
Added maximum concurrently usage to connection (connection can be used more than once at the time)
Random fixes and stability improvements