YGMapper 1.0.0
See the version list below for details.
dotnet add package YGMapper --version 1.0.0
NuGet\Install-Package YGMapper -Version 1.0.0
<PackageReference Include="YGMapper" Version="1.0.0" />
paket add YGMapper --version 1.0.0
#r "nuget: YGMapper, 1.0.0"
// Install YGMapper as a Cake Addin #addin nuget:?package=YGMapper&version=1.0.0 // Install YGMapper as a Cake Tool #tool nuget:?package=YGMapper&version=1.0.0
YGMapper
A simple mapper that maps one DTO to another DTO where the DTO types may or may not be identical
Installation
Include this package in the project file
Usage
for mapping all matching fields:
MapObjects mo1 = new MapObjects();
var result = mo1.Map<Entity2>(entity1);
or for mapping with included fields only (this will only include "Name", "EmailAddress" fields):
MapObjects mo2 = new MapObjects(new string[] { "Name", "EmailAddress" }, null);
var result2 = mo2.Map<Entity2>(entity1);
or for mapping with excluded fields (this will exclude "EmailAddress" field):
MapObjects mo3 = new MapObjects(null, new string[] { "EmailAddress" });
var result3 = mo3.Map<Entity2>(entity1);
Examples
Test project is provided in the solution to illustrate how to map a DTO, with included or excluded field names.
Output:
The output is Tuple<bool,string,T> , where Item1 represents whether or not the function has executed successfully, Item2 states the success or error message, and Item3 is the output DTO where the source object is mapped to.
Dependencies
none
Contributing
Any new ideas on how to enhance this class without adding much complexity, please adhere to SOLID principle
License
This project is licensed under the MIT License(LICENSE).
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. |
-
net8.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Initial release, simple mapping functionality to map one DTO to another, with filtering