Riok.Mapperly 2.6.0

.NET Standard 2.0
There is a newer prerelease 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, C# scripting and .NET Interactive. 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 (1)

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

Repository Stars
riok/mapperly
A .NET source generator for generating object mappings. No runtime reflection. Inspired by MapStruct.
Version Downloads Last updated
2.7.0-next.2 42 1/26/2023
2.7.0-next.1 49 1/23/2023
2.6.0 2,008 1/12/2023
2.6.0-next.4 45 1/11/2023
2.6.0-next.3 87 1/9/2023
2.6.0-next.2 167 12/14/2022
2.6.0-next.1 278 12/12/2022
2.5.0 19,732 10/12/2022
2.5.0-next.2 223 9/28/2022
2.5.0-next.1 104 9/19/2022
2.4.1-next.1 75 9/16/2022
2.4.0 6,209 9/8/2022
2.3.3 1,904 8/10/2022
2.3.2 242 8/9/2022
2.3.1 32,077 5/31/2022
2.3.0 1,641 5/16/2022
2.2.1 2,842 4/6/2022
2.2.0 515 3/15/2022
2.1.0 402 2/28/2022
2.0.0 261 2/21/2022