CleanMapper 1.0.1

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

NuGet Version License

๐Ÿงน CleanMapper

CleanMapper is a lightweight, reflection-minimal object mapping library for .NET. It enables fast, strongly-typed mappings between DTOs, ViewModels, and domain models with a clean and minimal API design.


โœจ Features

  • โœ… Strongly-typed mapping registration
  • โœ… Auto-maps properties with matching names and types
  • โœ… Profile-based configuration for organized mappings
  • โœ… Extension methods for mapping collections and advanced scenarios
  • โœ… Lightweight with no runtime reflection during mapping

๐Ÿš€ Installation

Install via NuGet:

dotnet add package CleanMapper

Or via the Package Manager:

Install-Package CleanMapper

๐Ÿ’ป Usage

โžก๏ธ 1. Create a Profile

Define a mapping profile to configure your mappings:

using CleanMapper.Core;

public class UserProfile : MapProfile
{
    public override void Configure(MappingConfiguration config)
    {
        config.CreateMap<UserDto, User>();
        config.CreateMap<User, UserDto>();
    }
}

โžก๏ธ 2. Map objects

var mapper = new Mapper(new UserProfile());

var dto = new UserDto { Id = 1, Name = "Taleh" };
var user = mapper.Map<UserDto, User>(dto);

โžก๏ธ 3. Map lists

using CleanMapper.Extensions; // โš ๏ธ Required for extension methods

var userDtos = new List<UserDto>
{
    new UserDto { Id = 1, Name = "Alice" },
    new UserDto { Id = 2, Name = "Bob" }
};

var users = mapper.MapList<UserDto, User>(userDtos).ToList();

๐Ÿ’ก Note: To use MapList, MapArray, and other collection mapping extensions, ensure you add:

using CleanMapper.Extensions;

Or add it as a global using in your project for convenience.


๐Ÿค Contributing

Contributions, issues, and feature requests are welcome!
Please open an issue to discuss improvements or submit a pull request directly.


๐Ÿ“„ License

This project is licensed under the MIT License. See LICENSE.txt for details.


๐Ÿ™Œ Author

CleanMapper is built with dedication by Taleh Karimov.


โญ Star this repository if you find it helpful, and follow for upcoming advanced mapping features!

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • 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.

Version Downloads Last Updated
1.0.1 20 6/27/2025
1.0.0 24 6/27/2025