Riok.Mapperly 2.7.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.

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

# [2.7.0](https://github.com/riok/mapperly/compare/v2.6.0...v2.7.0) (2023-03-13) ### Bug Fixes * do not map from indexed properties ([#232](https://github.com/riok/mapperly/issues/232)) ([8f0c08d](https://github.com/riok/mapperly/commit/8f0c08d9a3b2620b25556cde98ddd0d82f4635e4)) * improve enum mapping runtime exception ([#230](https://github.com/riok/mapperly/issues/230)) ([7a6b90b](https://github.com/riok/mapperly/commit/7a6b90bc954237c4b48adcd17bd860f3b91bd16a)) * register output as implementation source output ([#246](https://github.com/riok/mapperly/issues/246)) ([0eccd4d](https://github.com/riok/mapperly/commit/0eccd4d83c9e0bc0a02879832bf8ea6eca7c42b9)), closes [#72](https://github.com/riok/mapperly/issues/72) * resolve user defined mappings for init properties with correct nullability ([#257](https://github.com/riok/mapperly/issues/257)) ([f18e424](https://github.com/riok/mapperly/commit/f18e424195eb0137c2c7a3df56cf9aaf3acd141f)) * support mapping to target readonly collections ([#252](https://github.com/riok/mapperly/issues/252)) ([8fa4116](https://github.com/riok/mapperly/commit/8fa4116f7f121bfe392b9aaa64aa0feb496747e2)) ### Features * constructor mapping support for MapProperty attribute ([#239](https://github.com/riok/mapperly/issues/239)) ([631fb34](https://github.com/riok/mapperly/commit/631fb346af74add9f3f924866912cd0b01e1c8ff)) * datetime to dateonly and timeonly mapping ([#253](https://github.com/riok/mapperly/issues/253)) ([c40108d](https://github.com/riok/mapperly/commit/c40108dbb254869d2e363fb7382eb94845fd04fc)) * support IList<T>, List<T> and IReadOnlyList<T> targets ([#248](https://github.com/riok/mapperly/issues/248)) ([fcaf5a5](https://github.com/riok/mapperly/commit/fcaf5a5ec29f3ea1f0196d3c1bcee21927075aaf)) * support roslyn 4.5 ([#220](https://github.com/riok/mapperly/issues/220)) ([56c5aca](https://github.com/riok/mapperly/commit/56c5aca96f83f878f4c62871e12ebc4c4aa58e6a))

.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