The Principal Dev – Masterclass for Tech Leads

The Principal Dev – Masterclass for Tech Leads28-29 May

Join

Mapperly

Nuget Nuget Preview License Downloads GitHub Sponsors GitHub

Mapperly is a .NET source generator for generating object mappings.

Because Mapperly creates the mapping code at build time, there is minimal overhead at runtime. Even better, the generated code is perfectly readable, allowing you to verify the generated mapping code easily.

Documentation

The documentation is available here.

Quickstart

Installation

Add the NuGet Package to your project:

dotnet add package Riok.Mapperly

Create your first mapper

Create a mapper declaration as a partial class and apply the Riok.Mapperly.Abstractions.MapperAttribute attribute. Mapperly generates mapping method implementations for the defined mapping methods in the mapper.

// Mapper declaration
[Mapper]
public partial class CarMapper
{
    public partial CarDto CarToCarDto(Car car);
}

// Mapper usage
var mapper = new CarMapper();
var car = new Car { NumberOfSeats = 10, ... };
var dto = mapper.CarToCarDto(car);
dto.NumberOfSeats.ShouldBe(10);

Read the docs for any further information.

Release Channels

Mapperly is distributed through two release channels:

Support Policy

Only the latest version released on the stable channel is fully supported. We strive to support all .NET versions that are currently supported by Microsoft.

Upgrading

Find a list of breaking changes for each major version and upgrade guides here.

Support

Need assistance with Mapperly or looking for consulting services? The riok team is available to help with:

Reach out through GitHub Discussions for questions, or contact the riok team directly for professional consulting services at hello@riok.ch. You can also support the project and get priority support through GitHub Sponsors.

How To Contribute

We would love for you to contribute to Mapperly and help make it even better than it is today! Find information on how to contribute in the docs.

License

Mapperly is Apache 2.0 licensed.

Join libs.tech

...and unlock some superpowers

GitHub

We won't share your data with anyone else.