Dosaic.Plugins.Mapping.Mapster
1.0.30
dotnet add package Dosaic.Plugins.Mapping.Mapster --version 1.0.30
NuGet\Install-Package Dosaic.Plugins.Mapping.Mapster -Version 1.0.30
<PackageReference Include="Dosaic.Plugins.Mapping.Mapster" Version="1.0.30" />
paket add Dosaic.Plugins.Mapping.Mapster --version 1.0.30
#r "nuget: Dosaic.Plugins.Mapping.Mapster, 1.0.30"
// Install Dosaic.Plugins.Mapping.Mapster as a Cake Addin #addin nuget:?package=Dosaic.Plugins.Mapping.Mapster&version=1.0.30 // Install Dosaic.Plugins.Mapping.Mapster as a Cake Tool #tool nuget:?package=Dosaic.Plugins.Mapping.Mapster&version=1.0.30
Dosaic.Plugins.Mapping.Mapster
Dosaic.Plugins.Mapping.Mapster is a plugin
that allows other Dosaic components
to use dto mapping using Mapster
.
Installation
To install the nuget package follow these steps:
dotnet add package Dosaic.Plugins.Mapping.Mapster
or add as package reference to your .csproj
<PackageReference Include="Dosaic.Plugins.Mapping.Mapster" Version="" />
Appsettings.yml
You do not need to configure anything, because the implementation resolver, does this automatically at startup.
Usage
Currently its only implemented to generate the Mapster mapping rules by the "MapFromAttribute" so you can inline all mappings. If it is needed to do more, we need to implement it.
Example:
```csharp
internal class DbModel {
public string Id {get;set;}
public string LongName {get;set;}
}
internal class SomeDto {
public string Id {get;set;}
[MapFrom<DbModel>(nameof(DbModel.LongName))]
public string Name {get;set;}
}
// USAGE:
var dbModel = new DbModel { Id = "1", LongName = "LongName" };
var someDto = dbModel.Adapt<SomeDto>();
Console.WriteLine(someDto.Name); // "LongName"
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. 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. |
-
net9.0
- Dosaic.Hosting.Abstractions (>= 1.0.30)
- Mapster (>= 7.4.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.