Riok.Mapperly 3.2.0

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

Read the docs for any further information.

Upgrading

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

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.

Showing the top 20 packages that depend on Riok.Mapperly.

Packages Downloads
Volo.Abp.Mapperly
Package Description
2

# [3.2.0](https://github.com/riok/mapperly/compare/v3.1.0...v3.2.0) (2023-09-18) ### Bug Fixes * add correct type for default null-fallback statements when using nullable value types ([4fa4163](https://github.com/riok/mapperly/commit/4fa4163a39a1acaa554a0df104e7ecc458986dc6)) * Allow multiple MapEnumValueAttribute ([#672](https://github.com/riok/mapperly/issues/672)) ([71cbfdd](https://github.com/riok/mapperly/commit/71cbfddcb8b7c962dceb84b761a62f23813de468)) * fix spacing for casts and enum parse mappings ([#747](https://github.com/riok/mapperly/issues/747)) ([137f2fb](https://github.com/riok/mapperly/commit/137f2fbaba2587a681197b74af91c4f197b30eaa)) * generate correct nullability for external array elements ([#715](https://github.com/riok/mapperly/issues/715)) ([7bf8104](https://github.com/riok/mapperly/commit/7bf8104ea81586480a0cd150c87c057e96b7a476)) * prevent null initializing readonly members ([#678](https://github.com/riok/mapperly/issues/678)) ([f3d78b4](https://github.com/riok/mapperly/commit/f3d78b4884b55828c4f806ea9842378dfc8cd298)) * remove interface from attribute targets on the mapper attribute ([#686](https://github.com/riok/mapperly/issues/686)) ([b7e6e20](https://github.com/riok/mapperly/commit/b7e6e202f2b0bcd96025d1c7666cb364ef79cf00)) * resolve user implemented mappings correctly in queryable projections ([#736](https://github.com/riok/mapperly/issues/736)) ([8cee739](https://github.com/riok/mapperly/commit/8cee7390bf1363abd72b894b6c491fb1ace5bdd8)) * reuse user defined modifiers in method signatures ([#734](https://github.com/riok/mapperly/issues/734)) ([dcb2eff](https://github.com/riok/mapperly/commit/dcb2effb854661123db081d288091161438629b2)) ### Features * add mapper defaults attribute for assemblies ([#657](https://github.com/riok/mapperly/issues/657)) ([765aa0b](https://github.com/riok/mapperly/commit/765aa0b99e77c3c3ccf0127fd77f9b16b183a5e3)) * Add option to use other mappers ([#661](https://github.com/riok/mapperly/issues/661)) ([975f374](https://github.com/riok/mapperly/commit/975f37465a254ebbcea0a47d10795ec4fbd812f1)) * C[#12](https://github.com/riok/mapperly/issues/12) type alias support ([#719](https://github.com/riok/mapperly/issues/719)) ([c2f1f4f](https://github.com/riok/mapperly/commit/c2f1f4f5d25287b933cf0dc73bce95ed95a024e1)) * generate diagnostic warning when ignored members are explicitly mapped ([#708](https://github.com/riok/mapperly/issues/708)) ([4cd4e3a](https://github.com/riok/mapperly/commit/4cd4e3a89cab797b1aef5c46982732660c869942)) * Implement custom source formatting to improve performance ([#706](https://github.com/riok/mapperly/issues/706)) ([44b5df9](https://github.com/riok/mapperly/commit/44b5df946aa0eafa932ff49351c1c2914c725a07)) * Remove runtime dependency on Riok.Mapperly.Abstractions ([#711](https://github.com/riok/mapperly/issues/711)) ([f26f026](https://github.com/riok/mapperly/commit/f26f026d708b18e54213c1cedefc92718d836425)), closes [#685](https://github.com/riok/mapperly/issues/685) * Support C[#12](https://github.com/riok/mapperly/issues/12) primary constructors ([#720](https://github.com/riok/mapperly/issues/720)) ([b54b9a5](https://github.com/riok/mapperly/commit/b54b9a5c0cc1b09bfff230c42b8235052694e0d3)) * support for Roslyn 4.7 ([#718](https://github.com/riok/mapperly/issues/718)) ([876713d](https://github.com/riok/mapperly/commit/876713dd46445f8321e4494f6a6ccf047f2f0a21))

.NET Standard 2.0

  • No dependencies.

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