NeatMapper.Transitive
5.0.0
dotnet add package NeatMapper.Transitive --version 5.0.0
NuGet\Install-Package NeatMapper.Transitive -Version 5.0.0
<PackageReference Include="NeatMapper.Transitive" Version="5.0.0" />
paket add NeatMapper.Transitive --version 5.0.0
#r "nuget: NeatMapper.Transitive, 5.0.0"
// Install NeatMapper.Transitive as a Cake Addin #addin nuget:?package=NeatMapper.Transitive&version=5.0.0 // Install NeatMapper.Transitive as a Cake Tool #tool nuget:?package=NeatMapper.Transitive&version=5.0.0
.NEaT Mapper - Transitive
What is this package
Transitive maps for NeatMapper.
Allows mapping types by automatically chaining maps together, eg: If you have maps for types A → B and B → C you can also map A → C by chaining A → B → C, supports normal maps and asynchronous ones, also supports collections.
How to install
You can find all the other packages on Nuget https://www.nuget.org/profiles/xriuk
You can install this package directly from Nuget https://www.nuget.org/packages/NeatMapper.Transitive
How to use
While configuring your services simply add
services.AddNeatMapper();
services.AddNeatMapperTransitive();
Then define your maps
public class MyMaps :
INewMap<Product, ProductDto1>,
INewMap<ProductDto1, ProductDto2>
{
ProductDto1? INewMap<Product, ProductDto1>.Map(Product? source, MappingContext context){
if(source == null)
return null;
else{
return new ProductDto1{
Code = source.Code,
...
};
}
}
ProductDto2? INewMap<ProductDto1, ProductDto2>.Map(ProductDto1? source, MappingContext context){
if(source == null)
return null;
else{
return new ProductDto2{
Code = source.Code,
...
};
}
}
}
And you are ready to map your entities
var mapper = serviceProvider.GetRequiredService<IMapper>();
Product product = ...;
// Transitively maps Product to ProductDto1 and then to ProductDto2
ProductDto2 productDto2 = mapper.Map<ProductDto2>(product);
Advanced options
Find more advanced use cases in the website or in the extended tests project.
License
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. net5.0-windows was computed. 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 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 is compatible. 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. |
.NET Core | netcoreapp3.0 was computed. netcoreapp3.1 is compatible. |
.NET Standard | netstandard2.1 is compatible. |
.NET Framework | net47 is compatible. net471 was computed. net472 was computed. net48 is compatible. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETCoreApp 3.1
- Dijkstra.NET (>= 1.2.1)
- NeatMapper (>= 5.0.0 && < 6.0.0)
-
.NETFramework 4.7
- Dijkstra.NET (>= 1.2.1)
- NeatMapper (>= 5.0.0 && < 6.0.0)
-
.NETFramework 4.8
- Dijkstra.NET (>= 1.2.1)
- NeatMapper (>= 5.0.0 && < 6.0.0)
-
.NETStandard 2.1
- Dijkstra.NET (>= 1.2.1)
- NeatMapper (>= 5.0.0 && < 6.0.0)
-
net5.0
- Dijkstra.NET (>= 1.2.1)
- NeatMapper (>= 5.0.0 && < 6.0.0)
-
net6.0
- Dijkstra.NET (>= 1.2.1)
- NeatMapper (>= 5.0.0 && < 6.0.0)
-
net7.0
- Dijkstra.NET (>= 1.2.1)
- NeatMapper (>= 5.0.0 && < 6.0.0)
-
net8.0
- Dijkstra.NET (>= 1.2.1)
- NeatMapper (>= 5.0.0 && < 6.0.0)
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 |
---|---|---|
5.0.0 | 59 | 11/3/2024 |
See full changelog at https://www.neatmapper.org/transitive/changelog#500---2024-11-03