Riok.Mapperly 2.9.0-next.2

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.2](https://github.com/riok/mapperly/compare/v2.9.0-next.1...v2.9.0-next.2) (2023-06-13) ### Bug Fixes * clone array when deepcloning is enabled and target is an IEnumerable ([#431](https://github.com/riok/mapperly/issues/431)) ([082d877](https://github.com/riok/mapperly/commit/082d877e113378ec8d29b6928911ff4c398fe762)) * existing dictionary and enumerable mapping should respect enabled conversion types ([#459](https://github.com/riok/mapperly/issues/459)) ([86f48a2](https://github.com/riok/mapperly/commit/86f48a2a152e637f46e188c4ee11f7d369f23230)) * ignore user implemented generic methods ([#423](https://github.com/riok/mapperly/issues/423)) ([408d03f](https://github.com/riok/mapperly/commit/408d03fdc13a19ef254faa253e7745b452524068)) * only use instance constructors to create new object instances ([#458](https://github.com/riok/mapperly/issues/458)) ([848fb45](https://github.com/riok/mapperly/commit/848fb45c5d81ca868b2818a2496738eda57a1d25)) * prevent ctormapping using inaccessible constructors ([#456](https://github.com/riok/mapperly/issues/456)) ([125742e](https://github.com/riok/mapperly/commit/125742e799fb4ed166750ddc955750f5ab50f0cd)) * use ToList/ToArray to clone enumerable interfaces ([#432](https://github.com/riok/mapperly/issues/432)) ([f947cbf](https://github.com/riok/mapperly/commit/f947cbf868cc4a9ccdd7be2e4d55027229d2d3d7)) ### Features * add support for user defined generic mapping methods ([#461](https://github.com/riok/mapperly/issues/461)) ([ddbc516](https://github.com/riok/mapperly/commit/ddbc5169a3afe4d290c58b5e05c6e4b749a6f30d)) * Added MapEnumValueAttribute and support for explicit named enum value mapping ([#468](https://github.com/riok/mapperly/issues/468)) ([64e6c9d](https://github.com/riok/mapperly/commit/64e6c9d58862ea6beb88d11488a824cd5425220e)) * added source generator benchmark ([#419](https://github.com/riok/mapperly/issues/419)) ([b6836b2](https://github.com/riok/mapperly/commit/b6836b277e23a0028f6a762880be2c9efe4bff20)) * cache attribute symbols ([#478](https://github.com/riok/mapperly/issues/478)) ([fbe8ba1](https://github.com/riok/mapperly/commit/fbe8ba154efa5cd727affa5280bdc24dfd62a6aa)) * directly assign System.Uri and System.Version when deep cloning ([#440](https://github.com/riok/mapperly/issues/440)) ([c845b43](https://github.com/riok/mapperly/commit/c845b43bea2651b9e67b1bc7dae99c5320da60b1)) * explicit enum mappings for byValue enum mappings ([#489](https://github.com/riok/mapperly/issues/489)) ([029dae2](https://github.com/riok/mapperly/commit/029dae28de90722f0bf55f7aabed47027db5ed83)) * optimize BuildMemberPathCandidates performance ([#480](https://github.com/riok/mapperly/issues/480)) ([34b926b](https://github.com/riok/mapperly/commit/34b926b456b74a7c3c36c11be29c271547ddba6f)) * Support enum mapping is defined check and fallback values ([#491](https://github.com/riok/mapperly/issues/491)) ([f0065c8](https://github.com/riok/mapperly/commit/f0065c8c5e9fa4b3a26951e733c0d06bb5501816))

.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 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 21 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 24 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 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,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 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 28 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 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 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 26 07/05/2023
2.3.3 28 07/11/2023
2.3.2 27 07/07/2023
2.3.1 31 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