Skip to content

Latest commit

 

History

History
53 lines (35 loc) · 899 Bytes

File metadata and controls

53 lines (35 loc) · 899 Bytes

🚀 Getting Started with CleanMapper

CleanMapper is a lightweight, strongly-typed object mapping library for .NET. This guide helps you integrate it quickly.


✨ Installation

Install via NuGet:

dotnet add package CleanMapper

Or via Package Manager:

Install-Package CleanMapper

💻 Basic Usage

➡️ 1. Create a Profile

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);

For mapping collections or advanced scenarios, see Extensions.md.