EntityMapper 0.0.2-beta
This is a prerelease version of EntityMapper.
dotnet add package EntityMapper --version 0.0.2-beta
NuGet\Install-Package EntityMapper -Version 0.0.2-beta
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="EntityMapper" Version="0.0.2-beta" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add EntityMapper --version 0.0.2-beta
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: EntityMapper, 0.0.2-beta"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install EntityMapper as a Cake Addin
#addin nuget:?package=EntityMapper&version=0.0.2-beta&prerelease
// Install EntityMapper as a Cake Tool
#tool nuget:?package=EntityMapper&version=0.0.2-beta&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
EntityMapper - Work In Progress
.Net Object to object mapper library. Provides shallow and deep copy mapping of objects and collections.
How to Configure
EntityMapper.Mapper.Configure(cfg =>
{
cfg.ClearMappings();
cfg.CreateMap<A, A>(reversal: false);
cfg.CreateMap<B, B>(reversal: false);
cfg.CreateMap<A, ADto>(reversal: true);
cfg.CreateMap<B, BDto>(reversal: true);
cfg.Compile();
});
How to Ignore Property
EntityMapper.Mapper.Configure(cfg =>
{
cfg.ClearMappings();
cfg.CreateMap<B, BDto>(reversal: true).Ignore("PropertyName1", "PropertyName2");
cfg.Compile();
});
How to do Custom Mappings
EntityMapper.Mapper.Configure(cfg =>
{
cfg.ClearMappings();
cfg.CreateMap<C, CDto>(reversal: true).CustomMappings(
(source, dest) =>
{
if(source.Age > 5)
dest.NewAge = source.Age;
},
(source, dest) => { dest.Color = source.Name; }
);
cfg.Compile();
});
How to Map Objects
A source = new A();
B result = EntityMapper.Mapper.Current.Map<A, B>(source);
How to Map Lists
List<A> source = new List<A>(){new A(), new A()};
List<B> result = EntityMapper.Mapper.Current.MapList<List<A>, List<B>(source);
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. 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. |
.NET Core | netcoreapp2.2 is compatible. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETCoreApp 2.2
- Microsoft.CodeAnalysis.CSharp (>= 2.10.0)
- NETStandard.Library (>= 2.0.3)
- System.Linq.Dynamic.Core (>= 1.0.9.2)
- System.Threading (>= 4.3.0)
- System.Threading.Tasks (>= 4.3.0)
- System.Threading.Tasks.Parallel (>= 4.3.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 |
---|---|---|
0.0.2-beta | 480 | 5/3/2019 |
0.0.1-beta | 357 | 3/21/2019 |
Beta - Ignore propertis, Custom mappings