Riok.Mapperly 3.4.0

The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved
dotnet add package Riok.Mapperly --version 3.4.0
NuGet\Install-Package Riok.Mapperly -Version 3.4.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="3.4.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Riok.Mapperly --version 3.4.0
#r "nuget: Riok.Mapperly, 3.4.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=3.4.0

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

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

    • No dependencies.

NuGet packages (9)

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

Package Downloads
Fanzoo.Kernel The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

An opinionated framework for building scalable web applications.

Eternet.AspNetCore.DocumentDb.Crud The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

AspNet Core DocumentDb CRUD framework using Marten for Document DB and Events Store

Indice.Hive.Core

Package Description

DownDetect.Data.Lib

Added ApplePush Notification properties

LiveStreamingServerNet

A .NET implementation of RTMP server.

GitHub repositories (7)

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

Repository Stars
riok/mapperly
A .NET source generator for generating object mappings. No runtime reflection.
martinothamar/Mediator
A high performance implementation of Mediator pattern in .NET using source generators.
bitfoundation/bitplatform
Build everything for everywhere using what you already know and love ❤️
PlexRipper/PlexRipper
The best cross-platform Plex media downloader there is! In active development and feedback is very welcome!
Azure/iotedge-lorawan-starterkit
Sample implementation of LoRaWAN components to connect LoRaWAN antenna gateway running IoT Edge directly with Azure IoT.
Version Downloads Last updated
3.4.0 0 2/23/2024
3.4.0-next.5 61 2/20/2024
3.4.0-next.4 589 2/16/2024
3.4.0-next.3 2,058 2/5/2024
3.4.0-next.2 4,448 1/10/2024
3.4.0-next.1 271 1/6/2024
3.3.1-next.1 2,102 12/18/2023
3.3.0 151,972 12/12/2023
3.3.0-next.6 695 12/6/2023
3.3.0-next.5 864 11/28/2023
3.3.0-next.4 987 11/22/2023
3.3.0-next.3 2,135 11/19/2023
3.3.0-next.2 2,024 10/26/2023
3.3.0-next.1 2,433 10/11/2023
3.2.0 316,731 9/18/2023
3.2.0-next.4 1,350 9/12/2023
3.2.0-next.3 427 9/11/2023
3.2.0-next.2 242 9/5/2023
3.2.0-next.1 442 8/29/2023
3.1.0 108,499 8/18/2023
3.1.0-next.2 81 8/18/2023
3.1.0-next.1 3,831 8/8/2023
3.0.0 26,774 8/7/2023
3.0.0-next.1 268 8/2/2023
2.9.0-next.4 3,797 7/26/2023
2.9.0-next.3 487 7/16/2023
2.9.0-next.2 4,857 6/13/2023
2.9.0-next.1 5,501 5/11/2023
2.8.0 400,532 4/27/2023
2.8.0-next.2 493 4/20/2023
2.8.0-next.1 13,680 3/23/2023
2.7.1-next.1 638 3/17/2023
2.7.0 113,043 3/13/2023
2.7.0-next.2 745 1/26/2023
2.7.0-next.1 588 1/23/2023
2.6.0 66,620 1/12/2023
2.6.0-next.4 98 1/11/2023
2.6.0-next.3 144 1/9/2023
2.6.0-next.2 267 12/14/2022
2.6.0-next.1 543 12/12/2022
2.5.0 69,214 10/12/2022
2.5.0-next.2 301 9/28/2022
2.5.0-next.1 196 9/19/2022
2.4.1-next.1 165 9/16/2022
2.4.0 12,049 9/8/2022
2.3.3 2,831 8/10/2022
2.3.2 707 8/9/2022
2.3.1 60,865 5/31/2022
2.3.0 2,193 5/16/2022
2.2.1 3,327 4/6/2022
2.2.0 1,060 3/15/2022
2.1.0 875 2/28/2022
2.0.0 756 2/21/2022

# [3.4.0](https://github.com/riok/mapperly/compare/v3.3.0...v3.4.0) (2024-02-23)


### Bug Fixes

* correctly annotate nullable generics in disabled nullable contexts ([#1020](https://github.com/riok/mapperly/issues/1020)) ([d35c52d](https://github.com/riok/mapperly/commit/d35c52ddff74c4d357168d119f41d487953869d8))
* do not resolve existing one sideded loose nullable property mappings ([#1090](https://github.com/riok/mapperly/issues/1090)) ([7998720](https://github.com/riok/mapperly/commit/79987209b7922b92f96f8888a404e56db1b87569))
* don't diagnostic for constructor mappings when no instance can be created but none is needed anyway ([450d7ca](https://github.com/riok/mapperly/commit/450d7ca602a48ac39b6a2fb9567b6bdefcd4315e))
* generate enumerable mapping methods with interface parameters instead of concrete types to reduce generated methods ([#1088](https://github.com/riok/mapperly/issues/1088)) ([66752cf](https://github.com/riok/mapperly/commit/66752cfa000854a0ca9a1836d1a2abb4de4b1251))
* generate generic mapping only for matching source / target types if non-generic ([#1000](https://github.com/riok/mapperly/issues/1000)) ([9a2916f](https://github.com/riok/mapperly/commit/9a2916fc102b499078298771486ede1672af43d4))
* handle nullable correctly in nullable disabled contexts for generics and arrays ([#1029](https://github.com/riok/mapperly/issues/1029)) ([132b8cc](https://github.com/riok/mapperly/commit/132b8ccc9d1d755415c6f6b17fcab20e286fd77f))
* prevent collection mapping from using invalid length property ([#1108](https://github.com/riok/mapperly/issues/1108)) ([216f791](https://github.com/riok/mapperly/commit/216f791c786948b3f89ba20e19c53e04cd239628))
* prevent crash for delegate fields when deep mapping is enabled ([#1058](https://github.com/riok/mapperly/issues/1058)) ([88dd1ff](https://github.com/riok/mapperly/commit/88dd1ff9e732b53fb79cfaf3ff7d0a5013fea5b4))
* remove Runtime suffix of MapperlyAbstractionsScope msbuild option ([#1049](https://github.com/riok/mapperly/issues/1049)) ([54b0eea](https://github.com/riok/mapperly/commit/54b0eea7169a82f277e031bd25b8f0de04c369b0))
* upgrade parameter nullability correctly ([#1057](https://github.com/riok/mapperly/issues/1057)) ([ad917ee](https://github.com/riok/mapperly/commit/ad917ee4f1a547cd3d61a6e32776b49572ce08d1))
* use correct argument types in user defined enumerable mappings with an array source parameter ([#1125](https://github.com/riok/mapperly/issues/1125)) ([8b14725](https://github.com/riok/mapperly/commit/8b14725a9635ad05efd893df9a2b86463f98996e))


### Features

* add option to prefer parameterised constructors ([#1061](https://github.com/riok/mapperly/issues/1061)) ([e606f93](https://github.com/riok/mapperly/commit/e606f936e6c2f403fd875912924a7d38a4bdb6dc))
* annotate all emitted methods and classes with GeneratedCodeAttribute. ([#1069](https://github.com/riok/mapperly/issues/1069)) ([374e6cb](https://github.com/riok/mapperly/commit/374e6cb59dff49af5f0b7ef74919c6235bc2ba84))
* remove runtime dependency ([#1027](https://github.com/riok/mapperly/issues/1027)) ([ca3ea5a](https://github.com/riok/mapperly/commit/ca3ea5a9152a8466608bb320951f3995cca13bf1))