Riok.Mapperly 2.6.0

Mapperly

Nuget Nuget Preview GitHub Downloads GitHub

Mapperly is a .NET source generator for generating object mappings. Inspired by MapStruct.

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.Should().Be(10);

Read the docs for any further information.

License

Mapperly is Apache 2.0 licensed.

No packages depend on Riok.Mapperly.

# [2.6.0](https://github.com/riok/mapperly/compare/v2.5.0...v2.6.0) (2023-01-12) ### Bug Fixes * ensure unique names ([#224](https://github.com/riok/mapperly/issues/224)) ([282a3d3](https://github.com/riok/mapperly/commit/282a3d3025eeaa062a9d6ee8e3bc55c2ce7ba8f2)) * multi target roslyn 4.4 and 4.0 ([#205](https://github.com/riok/mapperly/issues/205)) ([90788d3](https://github.com/riok/mapperly/commit/90788d3bfcb4a025bc984dd369eef2ba519be6fb)) ### Features * add option to disable specific conversions ([#213](https://github.com/riok/mapperly/issues/213)) ([7430c94](https://github.com/riok/mapperly/commit/7430c94521393fa46a35d31a6561c8a905142e76)) * add property name mapping strategy ([#189](https://github.com/riok/mapperly/issues/189)) ([80ba9ae](https://github.com/riok/mapperly/commit/80ba9aecd77c4f0de3839c73dc97aeeedcdf8de2)) * required properties support ([#181](https://github.com/riok/mapperly/issues/181)) ([bb9504c](https://github.com/riok/mapperly/commit/bb9504c95d726d00dc056f25a1c2507f53770647)) * support reference loops ([#218](https://github.com/riok/mapperly/issues/218)) ([fd18a62](https://github.com/riok/mapperly/commit/fd18a62ee6d9a2c7b0b1c4f46c3477a32ac9c696))

.NET Standard 2.0

  • No dependencies.

Version Downloads Last updated
4.2.1 3 04/28/2025
4.2.1-next.2 1 04/25/2025
4.2.1-next.1 3 04/25/2025
4.2.1-next.0 5 04/14/2025
4.2.0 7 03/31/2025
4.2.0-next.2 7 03/23/2025
4.2.0-next.1 8 02/21/2025
4.2.0-next.0 9 01/26/2025
4.1.1 16 11/23/2024
4.1.1-next.0 17 11/07/2024
4.1.0 15 10/31/2024
4.1.0-next.3 14 10/31/2024
4.1.0-next.2 15 10/26/2024
4.1.0-next.1 15 10/16/2024
4.1.0-next.0 20 10/11/2024
4.0.0 17 10/11/2024
4.0.0-next.4 14 10/02/2024
4.0.0-next.3 21 08/17/2024
4.0.0-next.2 22 08/12/2024
4.0.0-next.1 21 07/01/2024
3.6.0 2,001 06/19/2024
3.6.0-next.2 25 06/06/2024
3.6.0-next.1 25 05/03/2024
3.5.1 24 04/23/2024
3.5.1-next.2 22 04/19/2024
3.5.1-next.1 22 04/09/2024
3.5.0 24 04/05/2024
3.5.0-next.4 24 03/27/2024
3.5.0-next.3 25 03/18/2024
3.5.0-next.2 21 03/16/2024
3.5.0-next.1 24 03/10/2024
3.4.0 22 03/01/2024
3.4.0-next.5 21 02/28/2024
3.4.0-next.4 21 02/19/2024
3.4.0-next.3 26 02/13/2024
3.4.0-next.2 26 01/12/2024
3.4.0-next.1 24 01/12/2024
3.3.1-next.1 27 12/21/2023
3.3.0 1,985 12/16/2023
3.3.0-next.6 27 12/10/2023
3.3.0-next.5 24 12/06/2023
3.3.0-next.4 24 12/06/2023
3.3.0-next.3 26 12/06/2023
3.3.0-next.2 24 10/26/2023
3.3.0-next.1 22 10/22/2023
3.2.0 26 09/19/2023
3.2.0-next.4 26 09/25/2023
3.2.0-next.3 26 09/12/2023
3.2.0-next.2 26 09/23/2023
3.2.0-next.1 24 09/03/2023
3.1.0 31 08/26/2023
3.1.0-next.2 26 08/23/2023
3.1.0-next.1 27 08/16/2023
3.0.0 27 08/16/2023
3.0.0-next.1 29 08/17/2023
2.9.0-next.4 25 08/06/2023
2.9.0-next.3 29 08/10/2023
2.9.0-next.2 25 07/05/2023
2.9.0-next.1 25 07/05/2023
2.8.0 29 07/05/2023
2.8.0-next.2 28 07/06/2023
2.8.0-next.1 493 04/13/2023
2.7.1-next.1 28 07/10/2023
2.7.0 29 07/08/2023
2.7.0-next.2 26 07/07/2023
2.7.0-next.1 23 07/07/2023
2.6.0 24 07/05/2023
2.6.0-next.4 25 07/04/2023
2.6.0-next.3 23 07/08/2023
2.6.0-next.2 27 07/07/2023
2.6.0-next.1 28 07/07/2023
2.5.0 31 06/27/2023
2.5.0-next.2 25 07/09/2023
2.5.0-next.1 28 07/06/2023
2.4.1-next.1 26 07/07/2023
2.4.0 26 07/05/2023
2.3.3 29 07/11/2023
2.3.2 27 07/07/2023
2.3.1 32 07/06/2023
2.3.0 31 07/05/2023
2.2.1 33 07/06/2023
2.2.0 27 07/04/2023
2.1.0 26 07/03/2023
2.0.0 28 07/17/2023