Riok.Mapperly 4.1.0

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Riok.Mapperly --version 4.1.0
                    
NuGet\Install-Package Riok.Mapperly -Version 4.1.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="4.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Riok.Mapperly" Version="4.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Riok.Mapperly" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Riok.Mapperly --version 4.1.0
                    
#r "nuget: Riok.Mapperly, 4.1.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.
#:package Riok.Mapperly@4.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Riok.Mapperly&version=4.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Riok.Mapperly&version=4.1.0
                    
Install as a Cake Tool

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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.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)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.

NuGet packages (34)

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

Package Downloads
Indice.Hive.Core

Package Description

AssemblyAI

The AssemblyAI C# .NET SDK provides an easy-to-use interface for interacting with the AssemblyAI API, which supports async and real-time transcription, audio intelligence models, as well as the latest LeMUR models.

Rocket.Surgery.LaunchPad.Mapping

Package Description

Fanzoo.Kernel

An opinionated framework for building scalable web applications.

TossPlatform.Common

TossPlatform Common for SDK

GitHub repositories (23)

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

Repository Stars
abpframework/abp
Open-source web application framework for ASP.NET Core! Offers an opinionated architecture to build enterprise software solutions with best practices on top of the .NET. Provides the fundamental infrastructure, cross-cutting-concern implementations, startup templates, application modules, UI themes, tooling and documentation.
martinothamar/Mediator
A high performance implementation of Mediator pattern in .NET using source generators.
lookup-foundation/RevitLookup
Interactive Revit RFA and RVT project database exploration tool to view and navigate BIM element parameters, properties and relationships.
bitfoundation/bitplatform
Build all of your apps using what you already know and love ❤️
velopack/velopack
Installer and automatic update framework for cross-platform desktop applications
Tim-Maes/Facet
Source generator that eliminates DTO boilerplate by auto-generating DTOs, mappings, and EF Core projections at compile time.
mehdihadeli/food-delivery-microservices
🍔 A practical and cloud-native food delivery microservices, built with .Net Aspire, .Net 9, MassTransit, Domain-Driven Design, CQRS, Vertical Slice Architecture, Event-Driven Architecture, and the latest technologies.
ThingsGateway/ThingsGateway
ThingsGateway is a cross-platform, high-performance gateway for edge data acquisition and IoT connectivity. Developed with .NET 8, it offers a suite of powerful tools, including advanced PLC communication libraries and debugging software.
yanpitangui/dotnet-api-boilerplate
A Dotnet 9.0 WebApi template project. MediatR, Swagger, Mapper, Serilog and more implemented.
nkdAgility/azure-devops-migration-tools
Azure DevOps Migration Tools allow you to migrate Teams, Backlogs, Work Items, Tasks, Test Cases, and Plans & Suits from one Project to another in Azure DevOps / TFS both within the same Organisation, and between Organisations.
josephnhtam/live-streaming-server-net
A .NET implementation of RTMP live streaming server, supporting HTTP-FLV, WebSocket-FLV, HLS, Kubernetes, cloud storage services integration and more.
mehdihadeli/vertical-slice-api-template
🍰 An asp.net core template based on .Net 9, Vertical Slice Architecture, CQRS, Minimal APIs, OpenTelemetry, API Versioning and OpenAPI.
svrooij/WinTuner
Package any app from Winget to Intune - WinTuner
higty/higlabo
HigLabo library provide 1.AI client library(OpenAI, Anthoripic, Groq) 2.Object Mapper(fastest in the world) 3.DbSharp(DAL generator) 4.Other.(Mail, Ftp, Utility...etc)
Azure/iotedge-lorawan-starterkit
Sample implementation of LoRaWAN components to connect LoRaWAN antenna gateway running IoT Edge directly with Azure IoT.
westonwalker/BlazorMinimalAPI
harrison314/BouncyHsm
Bouncy Hsm is a software simulator of HSM and smartcard simulator with HTML UI, REST API and PKCS#11 interface.
asesidaa/EXVS2-POC
MDModsDev/MuseDashModTools
UI app made by Avalonia framework for Muse Dash Mods
SapiensAnatis/Dawnshard
Server emulator for Dragalia Lost
Version Downloads Last Updated
4.3.1-next.0 113 12/4/2025
4.3.0 364,109 10/21/2025
4.3.0-next.6 2,184 10/15/2025
4.3.0-next.5 3,414 10/7/2025
4.3.0-next.4 2,875 9/18/2025
4.3.0-next.3 9,250 7/29/2025
4.3.0-next.2 12,869 6/16/2025
4.3.0-next.1 495 6/13/2025
4.3.0-next.0 1,846 5/27/2025
4.2.1 2,415,242 4/23/2025
4.2.1-next.2 236 4/21/2025
4.2.1-next.1 289 4/20/2025
4.2.1-next.0 1,122 4/8/2025
4.2.0 508,005 3/26/2025
4.2.0-next.2 1,845 3/18/2025
4.2.0-next.1 3,681 2/17/2025
4.2.0-next.0 75,900 1/20/2025
4.1.1 3,096,880 11/20/2024
4.1.1-next.0 28,199 11/5/2024
4.1.0 751,470 10/31/2024
4.1.0-next.3 253 10/29/2024
4.1.0-next.2 1,035 10/25/2024
4.1.0-next.1 1,293 10/14/2024
4.1.0-next.0 8,211 10/11/2024
4.0.0 334,305 10/11/2024
4.0.0-next.4 3,362 9/29/2024
4.0.0-next.3 31,067 8/13/2024
4.0.0-next.2 552 8/6/2024
4.0.0-next.1 14,872 6/30/2024
3.6.0 1,985,267 6/18/2024
3.6.0-next.2 4,373 6/3/2024
3.6.0-next.1 8,043 5/3/2024
3.5.1 647,258 4/23/2024
3.5.1-next.2 4,798 4/15/2024
3.5.1-next.1 303 4/9/2024
3.5.0 481,231 4/5/2024
3.5.0-next.4 1,583 3/27/2024
3.5.0-next.3 9,962 3/18/2024
3.5.0-next.2 45,339 3/11/2024
3.5.0-next.1 1,006 3/9/2024
3.4.0 519,641 2/23/2024
3.4.0-next.5 2,205 2/20/2024
3.4.0-next.4 954 2/16/2024
3.4.0-next.3 5,946 2/5/2024
3.4.0-next.2 25,353 1/10/2024
3.4.0-next.1 400 1/6/2024
3.3.1-next.1 3,035 12/18/2023
3.3.0 729,575 12/12/2023
3.3.0-next.6 1,089 12/6/2023
3.3.0-next.5 1,451 11/28/2023
3.3.0-next.4 2,836 11/22/2023
3.3.0-next.3 9,642 11/19/2023
3.3.0-next.2 4,226 10/26/2023
3.3.0-next.1 4,111 10/11/2023
3.2.0 825,070 9/18/2023
3.2.0-next.4 1,485 9/12/2023
3.2.0-next.3 580 9/11/2023
3.2.0-next.2 423 9/5/2023
3.2.0-next.1 577 8/29/2023
3.1.0 171,076 8/18/2023
3.1.0-next.2 199 8/18/2023
3.1.0-next.1 4,817 8/8/2023
3.0.0 47,567 8/7/2023
3.0.0-next.1 526 8/2/2023
2.9.0-next.4 8,004 7/26/2023
2.9.0-next.3 1,070 7/16/2023
2.9.0-next.2 5,185 6/13/2023
2.9.0-next.1 5,733 5/11/2023
2.8.0 716,869 4/27/2023
2.8.0-next.2 636 4/20/2023
2.8.0-next.1 20,471 3/23/2023
2.7.1-next.1 781 3/17/2023
2.7.0 200,769 3/13/2023
2.7.0-next.2 965 1/26/2023
2.7.0-next.1 738 1/23/2023
2.6.0 119,213 1/12/2023
2.6.0-next.4 236 1/11/2023
2.6.0-next.3 284 1/9/2023
2.6.0-next.2 430 12/14/2022
2.6.0-next.1 708 12/12/2022
2.5.0 98,884 10/12/2022
2.5.0-next.2 458 9/28/2022
2.5.0-next.1 374 9/19/2022
2.4.1-next.1 339 9/16/2022
2.4.0 22,321 9/8/2022
2.3.3 3,404 8/10/2022
2.3.2 1,182 8/9/2022
2.3.1 61,969 5/31/2022
2.3.0 2,692 5/16/2022
2.2.1 3,817 4/6/2022
2.2.0 1,546 3/15/2022
2.1.0 1,369 2/28/2022
2.0.0 1,576 2/21/2022

🚀 Features

support capacity settable members by @latonz in #1526

improve fullnameof and allow namespaced and nested types by @latonz in #1518

add roslyn 4.11 as target by @latonz in #1555

🐛 Bug Fixes

support capacity settable members by @latonz in #1526

ignore capacity related diagnostics for system collection types when mapping from custom type by @latonz in #1531

Removes the obsolete attribute from MapProperty.ctor(string\[], string\[]) by @latonz in #1535

allow assignments of MapValue constant value types to nullable value types by @latonz in #1536

handle nullable value types with MapValueAttribute and methods correct by @latonz in #1538

correct analysis of property member accessors by @latonz in #1556

simplify could not generate mapping exception syntax by @latonz in #1559

fix inconsistent handling of mixed nullable contexts by @latonz in #1558

allow multiple MapProperty attributes for the same target member by @latonz in #1560

correct handling mapping to read-only target arrays by @latonz in #1562

lazy load types which are not available on netstandard2.0 by @latonz in #1563

Full Changelog: https://github.com/riok/mapperly/compare/v4.0.0...v4.1.0