Riok.Mapperly 2.6.0

.NET Standard 2.0
There is a newer version of this package available.
See the version list below for details.
dotnet add package Riok.Mapperly --version 2.6.0
NuGet\Install-Package Riok.Mapperly -Version 2.6.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Riok.Mapperly" Version="2.6.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Riok.Mapperly --version 2.6.0
#r "nuget: Riok.Mapperly, 2.6.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Riok.Mapperly as a Cake Addin
#addin nuget:?package=Riok.Mapperly&version=2.6.0

// Install Riok.Mapperly as a Cake Tool
#tool nuget:?package=Riok.Mapperly&version=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.

Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows net7.0 net7.0-android net7.0-ios net7.0-maccatalyst net7.0-macos net7.0-tvos net7.0-windows
.NET Core netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard2.0 netstandard2.1
.NET Framework net461 net462 net463 net47 net471 net472 net48 net481
MonoAndroid monoandroid
MonoMac monomac
MonoTouch monotouch
Tizen tizen40 tizen60
Xamarin.iOS xamarinios
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Riok.Mapperly:

Package Downloads
Umbrella.Utilities.Mapping.Mapperly

This package contains Mapperly implementations of the Umbrella.Utilities.Mapping.Abstractions interfaces.

GitHub repositories (2)

Showing the top 2 popular GitHub repositories that depend on Riok.Mapperly:

Repository Stars
martinothamar/Mediator
A high performance implementation of Mediator pattern in .NET using source generators.
riok/mapperly
A .NET source generator for generating object mappings. No runtime reflection. Inspired by MapStruct.
Version Downloads Last updated
2.8.0-next.1 23 3/23/2023
2.7.1-next.1 97 3/17/2023
2.7.0 568 3/13/2023
2.7.0-next.2 330 1/26/2023
2.7.0-next.1 537 1/23/2023
2.6.0 13,217 1/12/2023
2.6.0-next.4 54 1/11/2023
2.6.0-next.3 100 1/9/2023
2.6.0-next.2 227 12/14/2022
2.6.0-next.1 483 12/12/2022
2.5.0 30,395 10/12/2022
2.5.0-next.2 234 9/28/2022
2.5.0-next.1 123 9/19/2022
2.4.1-next.1 89 9/16/2022
2.4.0 7,308 9/8/2022
2.3.3 2,134 8/10/2022
2.3.2 293 8/9/2022
2.3.1 36,958 5/31/2022
2.3.0 1,742 5/16/2022
2.2.1 2,900 4/6/2022
2.2.0 602 3/15/2022
2.1.0 453 2/28/2022
2.0.0 312 2/21/2022