ClearMapper 1.2.3

dotnet add package ClearMapper --version 1.2.3
                    
NuGet\Install-Package ClearMapper -Version 1.2.3
                    
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="ClearMapper" Version="1.2.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ClearMapper" Version="1.2.3" />
                    
Directory.Packages.props
<PackageReference Include="ClearMapper" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ClearMapper --version 1.2.3
                    
#r "nuget: ClearMapper, 1.2.3"
                    
#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.
#addin nuget:?package=ClearMapper&version=1.2.3
                    
Install ClearMapper as a Cake Addin
#tool nuget:?package=ClearMapper&version=1.2.3
                    
Install ClearMapper as a Cake Tool

ClearMapper 😃

ClearMapper is a package for map in c#. <br />

features:

  1. map from all of IEnumerable typr to another IEnumerable type with better performance and spped.
  2. map from IQueryable type to another IQueryable type with out roudtrip for database.
  3. map from any class to another class.
  4. 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .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.

Version Downloads Last updated
1.2.3 123 1/21/2025
1.2.2 112 1/21/2025
1.2.1 166 6/27/2024