EmBrito.Dataverse.Extensions.Data
1.0.1
dotnet add package EmBrito.Dataverse.Extensions.Data --version 1.0.1
NuGet\Install-Package EmBrito.Dataverse.Extensions.Data -Version 1.0.1
<PackageReference Include="EmBrito.Dataverse.Extensions.Data" Version="1.0.1" />
paket add EmBrito.Dataverse.Extensions.Data --version 1.0.1
#r "nuget: EmBrito.Dataverse.Extensions.Data, 1.0.1"
// Install EmBrito.Dataverse.Extensions.Data as a Cake Addin #addin nuget:?package=EmBrito.Dataverse.Extensions.Data&version=1.0.1 // Install EmBrito.Dataverse.Extensions.Data as a Cake Tool #tool nuget:?package=EmBrito.Dataverse.Extensions.Data&version=1.0.1
EmBrito.Dataverse.Extensions.Data
Data utilities for Dateverse client applications and plugin development.
Entity Mapper
Use a convetion based approach to data mapping and transformation by annotating your data transfer object. The mapper will automatically transform the data between between the column and property types while also giving access to Dataverse formatted values and string formatting.
// Sample class with the data annotation,
public class AccountDto : EntityMapper<AccountDto>
{
[FromStringColumn("name")]
public string Name { get; set; }
[FromOptionSetColumn("industrycode", formattedValue: true)]
public string IndustryCode { get; set; }
[FromOptionSetColumn("createdon", format: "yyyy-MM-dd")]
public string DateCreated { get; set; }
[FromCurrencyColumn("openrevenue")]
public decimal? Revenue { get; set; }
[FromOptionSetColumn("statecode")]
public int State { get; set; }
public AccountDto(Entity entity) : base(entity) {}
}
In this example an instance of the DTO is created from an account entity and then serialized to JSON:
Entity account = crmServiceClient.Retrieve("account", accountId, new ColumnSet(true));
AccountDto dto = new AccountDto(account);
// serializing the mapped object
string jsonString = JsonSerializer.Serialize(dto);
The JSON should look like this:
{
"Name": "Contoso",
"IndustryCode": "Business Services",
"DateCreated": "2023-01-12",
"Revenue": 3000000,
"AccountState": 1
}
Visit the project website for detailed documentation.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
.NET Framework | net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
-
.NETFramework 4.6.2
- Microsoft.CrmSdk.CoreAssemblies (>= 9.0.2.46)
-
net6.0
- Microsoft.PowerPlatform.Dataverse.Client (>= 1.0.26)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
1.0.1:
Project description and documentation update.
1.0.0:
Initial release.