Riok.Mapperly
4.2.0
Prefix Reserved
dotnet add package Riok.Mapperly --version 4.2.0
NuGet\Install-Package Riok.Mapperly -Version 4.2.0
<PackageReference Include="Riok.Mapperly" Version="4.2.0" />
paket add Riok.Mapperly --version 4.2.0
#r "nuget: Riok.Mapperly, 4.2.0"
// Install Riok.Mapperly as a Cake Addin #addin nuget:?package=Riok.Mapperly&version=4.2.0 // Install Riok.Mapperly as a Cake Tool #tool nuget:?package=Riok.Mapperly&version=4.2.0
Mapperly
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 | Versions 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. |
.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. |
-
.NETStandard 2.0
- No dependencies.
NuGet packages (19)
Showing the top 5 NuGet packages that depend on Riok.Mapperly:
Package | Downloads |
---|---|
Rocket.Surgery.LaunchPad.Mapping
Package Description |
|
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. |
|
Fanzoo.Kernel
An opinionated framework for building scalable web applications. |
|
TossPlatform.Common
TossPlatform Common for SDK |
GitHub repositories (18)
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.
|
|
jeremytammik/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 ❤️
|
|
ldqk/Masuit.MyBlogs
基于C#/.NET8的 masuit.org个人博客站项目源码,https://masuit.org ,供参考、学习、引用、非商业性质的部署。
|
Version | Downloads | Last updated |
---|---|---|
4.2.0 | 0 | 5 hours ago |
4.2.0-next.2 | 239 | 8 days ago |
4.2.0-next.1 | 2,100 | a month ago |
4.2.0-next.0 | 8,977 | 2 months ago |
4.1.1 | 742,479 | 4 months ago |
4.1.1-next.0 | 12,642 | 5 months ago |
4.1.0 | 309,988 | 5 months ago |
4.1.0-next.3 | 154 | 5 months ago |
4.1.0-next.2 | 985 | 5 months ago |
4.1.0-next.1 | 775 | 5 months ago |
4.1.0-next.0 | 2,870 | 5 months ago |
4.0.0 | 190,671 | 6 months ago |
4.0.0-next.4 | 2,299 | 6 months ago |
4.0.0-next.3 | 20,097 | 7 months ago |
4.0.0-next.2 | 497 | 8 months ago |
4.0.0-next.1 | 8,467 | 9 months ago |
3.6.0 | 1,306,969 | 9 months ago |
3.6.0-next.2 | 2,184 | 10 months ago |
3.6.0-next.1 | 6,754 | 5/3/2024 |
3.5.1 | 494,644 | 4/23/2024 |
3.5.1-next.2 | 2,302 | 4/15/2024 |
3.5.1-next.1 | 237 | 4/9/2024 |
3.5.0 | 326,632 | 4/5/2024 |
3.5.0-next.4 | 1,343 | 3/27/2024 |
3.5.0-next.3 | 9,873 | 3/18/2024 |
3.5.0-next.2 | 22,090 | 3/11/2024 |
3.5.0-next.1 | 687 | 3/9/2024 |
3.4.0 | 418,680 | 2/23/2024 |
3.4.0-next.5 | 1,780 | 2/20/2024 |
3.4.0-next.4 | 903 | 2/16/2024 |
3.4.0-next.3 | 4,793 | 2/5/2024 |
3.4.0-next.2 | 21,265 | 1/10/2024 |
3.4.0-next.1 | 341 | 1/6/2024 |
3.3.1-next.1 | 2,950 | 12/18/2023 |
3.3.0 | 615,520 | 12/12/2023 |
3.3.0-next.6 | 1,028 | 12/6/2023 |
3.3.0-next.5 | 1,394 | 11/28/2023 |
3.3.0-next.4 | 2,742 | 11/22/2023 |
3.3.0-next.3 | 8,316 | 11/19/2023 |
3.3.0-next.2 | 3,619 | 10/26/2023 |
3.3.0-next.1 | 3,832 | 10/11/2023 |
3.2.0 | 709,864 | 9/18/2023 |
3.2.0-next.4 | 1,408 | 9/12/2023 |
3.2.0-next.3 | 474 | 9/11/2023 |
3.2.0-next.2 | 356 | 9/5/2023 |
3.2.0-next.1 | 491 | 8/29/2023 |
3.1.0 | 158,794 | 8/18/2023 |
3.1.0-next.2 | 118 | 8/18/2023 |
3.1.0-next.1 | 4,672 | 8/8/2023 |
3.0.0 | 43,772 | 8/7/2023 |
3.0.0-next.1 | 387 | 8/2/2023 |
2.9.0-next.4 | 6,916 | 7/26/2023 |
2.9.0-next.3 | 869 | 7/16/2023 |
2.9.0-next.2 | 5,083 | 6/13/2023 |
2.9.0-next.1 | 5,585 | 5/11/2023 |
2.8.0 | 593,201 | 4/27/2023 |
2.8.0-next.2 | 535 | 4/20/2023 |
2.8.0-next.1 | 18,126 | 3/23/2023 |
2.7.1-next.1 | 677 | 3/17/2023 |
2.7.0 | 178,356 | 3/13/2023 |
2.7.0-next.2 | 859 | 1/26/2023 |
2.7.0-next.1 | 627 | 1/23/2023 |
2.6.0 | 100,145 | 1/12/2023 |
2.6.0-next.4 | 131 | 1/11/2023 |
2.6.0-next.3 | 189 | 1/9/2023 |
2.6.0-next.2 | 309 | 12/14/2022 |
2.6.0-next.1 | 590 | 12/12/2022 |
2.5.0 | 90,488 | 10/12/2022 |
2.5.0-next.2 | 358 | 9/28/2022 |
2.5.0-next.1 | 259 | 9/19/2022 |
2.4.1-next.1 | 226 | 9/16/2022 |
2.4.0 | 22,028 | 9/8/2022 |
2.3.3 | 3,133 | 8/10/2022 |
2.3.2 | 941 | 8/9/2022 |
2.3.1 | 61,652 | 5/31/2022 |
2.3.0 | 2,447 | 5/16/2022 |
2.2.1 | 3,562 | 4/6/2022 |
2.2.0 | 1,288 | 3/15/2022 |
2.1.0 | 1,102 | 2/28/2022 |
2.0.0 | 1,239 | 2/21/2022 |
🚀 Features
feat: Separate RequiredMappingStrategy configuration for enums by @jacob-buckaroo in #1591
feat: Diagnostic for mapping null mismatch by @latonz in #1612
feat: Add support for From and To method conversions (#1117) by @TonEnfer in #1616
feat: do not apply deep cloning to queryable projection mappings by @latonz in #1717
feat: add NotNullIfNotNull attribute on generated methods, support it on user implemented methods by @latonz in #1718
feat: support named mappings for existing target objects by @clegoz in #1720
🐛 Bug Fixes
fix: missing global alias on method argument in inlined user-implemented method #1629 by @TonEnfer in #1630
fix: initialize nullable members for nested containers by @clegoz in #1660
fix: only diagnostic missing member mappings for required init members by @latonz in #1686
fix: do not emit null coalesce operator in queryable mappings by @latonz in #1716
fix: correct nameof expression for enum value checked mappings by @latonz in #1741
Full Changelog: https://github.com/riok/mapperly/compare/v4.1.1...v4.2.0