ClearMapper 1.2.3
dotnet add package ClearMapper --version 1.2.3
NuGet\Install-Package ClearMapper -Version 1.2.3
<PackageReference Include="ClearMapper" Version="1.2.3" />
<PackageVersion Include="ClearMapper" Version="1.2.3" />
<PackageReference Include="ClearMapper" />
paket add ClearMapper --version 1.2.3
#r "nuget: ClearMapper, 1.2.3"
#addin nuget:?package=ClearMapper&version=1.2.3
#tool nuget:?package=ClearMapper&version=1.2.3
ClearMapper 😃
ClearMapper is a package for map in c#. <br />
features:
- map from all of IEnumerable typr to another IEnumerable type with better performance and spped.
- map from IQueryable type to another IQueryable type with out roudtrip for database.
- map from any class to another class.
- and ...
how to use?
step 1: create two classes with below names. FirstClass SecondClass
public class FirstClass
{
public int FistClassID { get; set; }
public string Title { get; set; }
}
public class SecondClass
{
public int SecondClassID { get; set; }
public string FullName { get; set; }
}
step 2: install 'ClearMapper' package from NUGET.
step 3: create Profile class For configure of map for ClearMapper
public class Profile : ClearMapperProfile
{
public Profile(ClearMapperOption option) : base(option)
{
option.AddConfiguration<FirstClass, SecondClass>(i =>
new SecondClass()
{
SecondClassID = i.FistClassID,
FullName = i.Title,
});
}
}
step 4: create insatance of CLearMapper of inject it from IOC. and call Map for map my class to another class.
var mapper = new ClearMapper();
//define some objection for mapping process
var firstClass = new FirstClass()
{
FistClassID = 10
};
var listOfFistClass = new List<FirstClass>();
listOfFistClass.Add(firstClass);
//map list of FirstClass to list of SecondClass
var listOfSecondClass = mapper.Map<FirstClass, SecondClass>(listOfFistClass);
//map list of FirstClass to list of ThirdClass
var listOfThirdClass = mapper.Map<FirstClass, ThirdClass>(listOfFistClass);
//Map single of FirstClass to another single of SecondClass
var secondClass = mapper.Map<FirstClass, SecondClass>(firstClass);
how to inject in program.cs:
install 'ClearMapper.DependencyInjection' from NUGET. and write below code in program.cs
builder.Services.UseClearMapper()
and inject IMapper in your classes like this:
public class MyClass
{
public MyClass(IMapper mapper)
{
}
}
don't forget to share ClearMapper with your friends. thanks 😃
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. 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. |
.NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
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. |
-
.NETStandard 2.1
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on ClearMapper:
Package | Downloads |
---|---|
ClearMapper.DependencyInjection
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.