Chd.Mapping
8.0.4
dotnet add package Chd.Mapping --version 8.0.4
NuGet\Install-Package Chd.Mapping -Version 8.0.4
<PackageReference Include="Chd.Mapping" Version="8.0.4" />
<PackageVersion Include="Chd.Mapping" Version="8.0.4" />
<PackageReference Include="Chd.Mapping" />
paket add Chd.Mapping --version 8.0.4
#r "nuget: Chd.Mapping, 8.0.4"
#:package Chd.Mapping@8.0.4
#addin nuget:?package=Chd.Mapping&version=8.0.4
#tool nuget:?package=Chd.Mapping&version=8.0.4
Caching library for .Net Core
Chd (cleverly handle difficulty) library helps you cleverly handle difficulty, writing code fastly and do your application stable.
📝 Table of Contents
🧐 About
Mapping library is a compile time aspect oriented programming library. This maps object to another object automatically with compile time aspect oriented programming.
🏁 Getting Started
This library is used to map object to another object automatically with compile time aspect oriented programming. In this reason your code do not use reflection for mapping. So your code run faster than other mapping libraries. Debugging is easier than other mapping libraries because mapping is done at compile time. If you use mapping with a package like AutoMapper, your code use reflection for mapping. So your code run slower than mapping with compile time aspect oriented programming. The important reason is that mapping with compile time aspect oriented programming is type safe. So you can catch mapping errors at compile time. Other mapping libraries use reflection for mapping. So you can not catch mapping errors at compile time. You can catch mapping errors at runtime. This is a big disadvantage. Automaticly generating implicit and explicit operator overloads for mapping between classes. Debugging is easier because you can see the mapping code in the generated code. Resolving mapping issues at compile time rather than at runtime, which can help to catch errors early in the development process. More efficient and faster code execution since the mapping code is generated at compile time rather than using reflection at runtime. There are two attribute that you can use for mapping. These are MapTo and MapFrom attributes. MapTo attribute is used to map class to another class. MapFrom attribute is used to map property to another property. MapFrom attribute takes a parameter that is the name of the property that you want to map.
🛠️ Prerequisites
- You must use .net core 8.0 or higher
- You must install Fody 6.6.0 or higher for your project. You can install Fody from Nuget Package Manager.
public class SampleEntity
{ public int Id { get; set;}
public string Name { get; set;}
}
[MapTo(typeof(SampleEntity))] //Mapping SampleEntity to SampleDto
public class SampleDto
{
public int Id { get; set;}
[MapFrom("Name")] //Mapping Name property of SampleEntity to FullName property of SampleDto
public string FullName { get; set;}
}
....
....
}
🎈 Usage
static void Main(string[] args)
{
var dto = new SampleDto { Id = 1, FullName = "Test" };
var entity=dto;
}
📑 Test Result
⛏️ Built Using
✍️ Authors
- Mehmet Yoldaş - Linkedin
See also the list of contributors who participated in this project.
🎉 Acknowledgements
Thank you for using my library.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. 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. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- FodyHelpers (>= 6.9.3)
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 |
|---|