Skip to content

Latest commit

 

History

History
37 lines (25 loc) · 699 Bytes

File metadata and controls

37 lines (25 loc) · 699 Bytes

📂 Using Profiles in CleanMapper

Profiles in CleanMapper group your mappings logically.


✨ Why use profiles?

✔️ Organize mappings per domain or module
✔️ Register multiple profiles in a single mapper


💻 Example

public class OrderProfile : MapProfile
{
    public override void Configure(MappingConfiguration config)
    {
        config.CreateMap<OrderDto, Order>();
        config.CreateMap<OrderItemDto, OrderItem>();
    }
}

➡️ Adding multiple profiles

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

Best Practice: Create separate profiles for each module to keep configurations clean.