Riok.Mapperly
2.6.0
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
<PackageReference Include="Riok.Mapperly" Version="2.6.0" />
paket add Riok.Mapperly --version 2.6.0
#r "nuget: Riok.Mapperly, 2.6.0"
// 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
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 |
-
.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 |
# [2.6.0](https://github.com/riok/mapperly/compare/v2.5.0...v2.6.0) (2023-01-12)
### Bug Fixes
* ensure unique names ([#224](https://github.com/riok/mapperly/issues/224)) ([282a3d3](https://github.com/riok/mapperly/commit/282a3d3025eeaa062a9d6ee8e3bc55c2ce7ba8f2))
* multi target roslyn 4.4 and 4.0 ([#205](https://github.com/riok/mapperly/issues/205)) ([90788d3](https://github.com/riok/mapperly/commit/90788d3bfcb4a025bc984dd369eef2ba519be6fb))
### Features
* add option to disable specific conversions ([#213](https://github.com/riok/mapperly/issues/213)) ([7430c94](https://github.com/riok/mapperly/commit/7430c94521393fa46a35d31a6561c8a905142e76))
* add property name mapping strategy ([#189](https://github.com/riok/mapperly/issues/189)) ([80ba9ae](https://github.com/riok/mapperly/commit/80ba9aecd77c4f0de3839c73dc97aeeedcdf8de2))
* required properties support ([#181](https://github.com/riok/mapperly/issues/181)) ([bb9504c](https://github.com/riok/mapperly/commit/bb9504c95d726d00dc056f25a1c2507f53770647))
* support reference loops ([#218](https://github.com/riok/mapperly/issues/218)) ([fd18a62](https://github.com/riok/mapperly/commit/fd18a62ee6d9a2c7b0b1c4f46c3477a32ac9c696))