Riok.Mapperly 2.9.0-next.3

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.

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.

No packages depend on Riok.Mapperly.

# [2.9.0-next.3](https://github.com/riok/mapperly/compare/v2.9.0-next.2...v2.9.0-next.3) (2023-07-16) ### Bug Fixes * Add <auto-generated /> comment ([#496](https://github.com/riok/mapperly/issues/496)) ([b3e1657](https://github.com/riok/mapperly/commit/b3e1657325cfd65e6e678d841519c022a8bdf9a3)) * add private does not obscure test ([#554](https://github.com/riok/mapperly/issues/554)) ([f6d8d34](https://github.com/riok/mapperly/commit/f6d8d3440812deb6fe43574ebdf6a79e3797a8d9)) * allow reference handling for generic and runtime target type mapping methods ([#508](https://github.com/riok/mapperly/issues/508)) ([34b237f](https://github.com/riok/mapperly/commit/34b237fb44129fd7867a5f4fdda71872ded3aeff)) * generate nameof compatible member access ([#539](https://github.com/riok/mapperly/issues/539)) ([92673db](https://github.com/riok/mapperly/commit/92673dbfbb02d636b3de5dea6b024f93cb94c933)) * map existing target sets correct ([#500](https://github.com/riok/mapperly/issues/500)) ([38e6556](https://github.com/riok/mapperly/commit/38e655630453b0dfe98fa76d73e5de4845eba405)) * prevent duplicates attributes and base types for nested mappers ([#544](https://github.com/riok/mapperly/issues/544)) ([44667c8](https://github.com/riok/mapperly/commit/44667c8576d404bca9ce2696b90746d5d4e97a16)) * required/init properties not using PropertyNameMappingStrategy ([#505](https://github.com/riok/mapperly/issues/505)) ([#556](https://github.com/riok/mapperly/issues/556)) ([564a43e](https://github.com/riok/mapperly/commit/564a43e2f62d458ebad32fc33c943f376c571c4e)) ### Features * add IgnoreObsoleteMembers ([#392](https://github.com/riok/mapperly/issues/392)) ([def10cf](https://github.com/riok/mapperly/commit/def10cf187f14f5b8bcc3d4689fe86266deea4fb)) * add option to ignore enum values ([#536](https://github.com/riok/mapperly/issues/536)) ([3e2a2c8](https://github.com/riok/mapperly/commit/3e2a2c891440c0101ce00b5a391edbc9d93b2bfe)) * add support for and mappings ([#425](https://github.com/riok/mapperly/issues/425)) ([ac254ca](https://github.com/riok/mapperly/commit/ac254ca2ee276d26736e4ad406cfe04f534ff6a9)) * diagnostic if an incompatible language version is used ([#566](https://github.com/riok/mapperly/issues/566)) ([38332a6](https://github.com/riok/mapperly/commit/38332a68155d42570a93cd43d4e21f9610a4690b)) * ISet and IReadOnlySet support ([#502](https://github.com/riok/mapperly/issues/502)) ([9550ae4](https://github.com/riok/mapperly/commit/9550ae4591fd27652f4ff0aa403f2f1a38e41033)) * optimize enum ByValueCheckDefined strategy and support flags ([#510](https://github.com/riok/mapperly/issues/510)) ([602c79d](https://github.com/riok/mapperly/commit/602c79dadbadd3f03a335a3bde2279950855f6cf)) * support derived type configuration inheritance ([#509](https://github.com/riok/mapperly/issues/509)) ([66124f8](https://github.com/riok/mapperly/commit/66124f8509f278f9e62428916db7cbafbcea5716))

.NET Standard 2.0

  • No dependencies.

Version Downloads Last updated
4.2.1 2 04/28/2025
4.2.1-next.2 1 04/25/2025
4.2.1-next.1 1 04/25/2025
4.2.1-next.0 5 04/14/2025
4.2.0 6 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 8 01/26/2025
4.1.1 16 11/23/2024
4.1.1-next.0 16 11/07/2024
4.1.0 15 10/31/2024
4.1.0-next.3 14 10/31/2024
4.1.0-next.2 14 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 20 08/17/2024
4.0.0-next.2 21 08/12/2024
4.0.0-next.1 20 07/01/2024
3.6.0 1,999 06/19/2024
3.6.0-next.2 24 06/06/2024
3.6.0-next.1 24 05/03/2024
3.5.1 23 04/23/2024
3.5.1-next.2 22 04/19/2024
3.5.1-next.1 21 04/09/2024
3.5.0 24 04/05/2024
3.5.0-next.4 23 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 23 03/10/2024
3.4.0 21 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 25 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,984 12/16/2023
3.3.0-next.6 27 12/10/2023
3.3.0-next.5 23 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 21 10/22/2023
3.2.0 25 09/19/2023
3.2.0-next.4 25 09/25/2023
3.2.0-next.3 25 09/12/2023
3.2.0-next.2 26 09/23/2023
3.2.0-next.1 24 09/03/2023
3.1.0 30 08/26/2023
3.1.0-next.2 26 08/23/2023
3.1.0-next.1 27 08/16/2023
3.0.0 26 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 27 08/10/2023
2.9.0-next.2 24 07/05/2023
2.9.0-next.1 24 07/05/2023
2.8.0 28 07/05/2023
2.8.0-next.2 28 07/06/2023
2.8.0-next.1 491 04/13/2023
2.7.1-next.1 27 07/10/2023
2.7.0 29 07/08/2023
2.7.0-next.2 25 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 27 07/07/2023
2.5.0 30 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 25 07/05/2023
2.3.3 28 07/11/2023
2.3.2 27 07/07/2023
2.3.1 30 07/06/2023
2.3.0 31 07/05/2023
2.2.1 32 07/06/2023
2.2.0 27 07/04/2023
2.1.0 26 07/03/2023
2.0.0 28 07/17/2023