Riok.Mapperly
2.8.0
Prefix Reserved
See the version list below for details.
dotnet add package Riok.Mapperly --version 2.8.0
NuGet\Install-Package Riok.Mapperly -Version 2.8.0
<PackageReference Include="Riok.Mapperly" Version="2.8.0" />
paket add Riok.Mapperly --version 2.8.0
#r "nuget: Riok.Mapperly, 2.8.0"
// Install Riok.Mapperly as a Cake Addin #addin nuget:?package=Riok.Mapperly&version=2.8.0 // Install Riok.Mapperly as a Cake Tool #tool nuget:?package=Riok.Mapperly&version=2.8.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.
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. |
.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 (16)
Showing the top 5 NuGet packages that depend on Riok.Mapperly:
Package | Downloads |
---|---|
Rocket.Surgery.LaunchPad.Mapping
Package Description |
|
Indice.Hive.Core
Package Description |
|
Fanzoo.Kernel
An opinionated framework for building scalable web applications. |
|
Eternet.AspNetCore.DocumentDb.Crud
AspNet Core DocumentDb CRUD framework using Marten for Document DB and Events Store |
|
BeamOS.Tests.Common
Package Description |
GitHub repositories (13)
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 all of your apps using what you already know and love ❤️
|
|
mehdihadeli/food-delivery-microservices
🍔 A practical and imaginary food delivery microservices, built with .Net 8, MassTransit, Domain-Driven Design, CQRS, Vertical Slice Architecture, Event-Driven Architecture, and the latest technologies.
|
|
velopack/velopack
Installer and automatic update framework for cross-platform desktop applications
|
Version | Downloads | Last updated |
---|---|---|
4.1.1-next.0 | 427 | 11/5/2024 |
4.1.0 | 41,027 | 10/31/2024 |
4.1.0-next.3 | 103 | 10/29/2024 |
4.1.0-next.2 | 378 | 10/25/2024 |
4.1.0-next.1 | 555 | 10/14/2024 |
4.1.0-next.0 | 510 | 10/11/2024 |
4.0.0 | 74,186 | 10/11/2024 |
4.0.0-next.4 | 1,339 | 9/29/2024 |
4.0.0-next.3 | 10,678 | 8/13/2024 |
4.0.0-next.2 | 467 | 8/6/2024 |
4.0.0-next.1 | 2,904 | 6/30/2024 |
3.6.0 | 769,989 | 6/18/2024 |
3.6.0-next.2 | 1,589 | 6/3/2024 |
3.6.0-next.1 | 4,547 | 5/3/2024 |
3.5.1 | 389,487 | 4/23/2024 |
3.5.1-next.2 | 1,244 | 4/15/2024 |
3.5.1-next.1 | 224 | 4/9/2024 |
3.5.0 | 222,135 | 4/5/2024 |
3.5.0-next.4 | 1,090 | 3/27/2024 |
3.5.0-next.3 | 8,742 | 3/18/2024 |
3.5.0-next.2 | 13,495 | 3/11/2024 |
3.5.0-next.1 | 622 | 3/9/2024 |
3.4.0 | 353,849 | 2/23/2024 |
3.4.0-next.5 | 1,560 | 2/20/2024 |
3.4.0-next.4 | 879 | 2/16/2024 |
3.4.0-next.3 | 3,868 | 2/5/2024 |
3.4.0-next.2 | 17,913 | 1/10/2024 |
3.4.0-next.1 | 325 | 1/6/2024 |
3.3.1-next.1 | 2,795 | 12/18/2023 |
3.3.0 | 540,023 | 12/12/2023 |
3.3.0-next.6 | 1,005 | 12/6/2023 |
3.3.0-next.5 | 1,363 | 11/28/2023 |
3.3.0-next.4 | 2,299 | 11/22/2023 |
3.3.0-next.3 | 6,910 | 11/19/2023 |
3.3.0-next.2 | 3,322 | 10/26/2023 |
3.3.0-next.1 | 3,668 | 10/11/2023 |
3.2.0 | 620,672 | 9/18/2023 |
3.2.0-next.4 | 1,389 | 9/12/2023 |
3.2.0-next.3 | 458 | 9/11/2023 |
3.2.0-next.2 | 321 | 9/5/2023 |
3.2.0-next.1 | 479 | 8/29/2023 |
3.1.0 | 147,899 | 8/18/2023 |
3.1.0-next.2 | 109 | 8/18/2023 |
3.1.0-next.1 | 4,500 | 8/8/2023 |
3.0.0 | 39,426 | 8/7/2023 |
3.0.0-next.1 | 350 | 8/2/2023 |
2.9.0-next.4 | 6,565 | 7/26/2023 |
2.9.0-next.3 | 700 | 7/16/2023 |
2.9.0-next.2 | 5,059 | 6/13/2023 |
2.9.0-next.1 | 5,560 | 5/11/2023 |
2.8.0 | 532,515 | 4/27/2023 |
2.8.0-next.2 | 520 | 4/20/2023 |
2.8.0-next.1 | 17,071 | 3/23/2023 |
2.7.1-next.1 | 661 | 3/17/2023 |
2.7.0 | 168,605 | 3/13/2023 |
2.7.0-next.2 | 817 | 1/26/2023 |
2.7.0-next.1 | 611 | 1/23/2023 |
2.6.0 | 89,583 | 1/12/2023 |
2.6.0-next.4 | 112 | 1/11/2023 |
2.6.0-next.3 | 170 | 1/9/2023 |
2.6.0-next.2 | 292 | 12/14/2022 |
2.6.0-next.1 | 569 | 12/12/2022 |
2.5.0 | 82,211 | 10/12/2022 |
2.5.0-next.2 | 326 | 9/28/2022 |
2.5.0-next.1 | 228 | 9/19/2022 |
2.4.1-next.1 | 200 | 9/16/2022 |
2.4.0 | 18,388 | 9/8/2022 |
2.3.3 | 3,080 | 8/10/2022 |
2.3.2 | 905 | 8/9/2022 |
2.3.1 | 61,557 | 5/31/2022 |
2.3.0 | 2,408 | 5/16/2022 |
2.2.1 | 3,527 | 4/6/2022 |
2.2.0 | 1,248 | 3/15/2022 |
2.1.0 | 1,061 | 2/28/2022 |
2.0.0 | 1,148 | 2/21/2022 |
# [2.8.0](https://github.com/riok/mapperly/compare/v2.7.0...v2.8.0) (2023-04-27)
### Bug Fixes
* add fully qualified Names for method parameters, return types, new constructor call and generic types ([#318](https://github.com/riok/mapperly/issues/318)) ([36830e8](https://github.com/riok/mapperly/commit/36830e8f8b56ec2aa0c839af8844dc5beb7c1de1))
* add target type to the RMG012 diagnostic ([#310](https://github.com/riok/mapperly/issues/310)) ([c092049](https://github.com/riok/mapperly/commit/c0920494efdd52345c6efdc4a0c021c9b4e5da64))
* create a new NameBuilder scope inside lambda expressions ([#358](https://github.com/riok/mapperly/issues/358)) ([1b475a7](https://github.com/riok/mapperly/commit/1b475a74147570716890b2d1f541ba16f847d09e))
* do not diagnostic property not found if target is read only ([#345](https://github.com/riok/mapperly/issues/345)) ([6ec7e80](https://github.com/riok/mapperly/commit/6ec7e802b301e792ef6786dcd7d1c9d37b80085c))
* dont map to read only dictionaries ([#285](https://github.com/riok/mapperly/issues/285)) ([dce4b42](https://github.com/riok/mapperly/commit/dce4b422f82bf523b572e22fff0b28e223a83a5d))
* enable static user methods for instance mappers ([#364](https://github.com/riok/mapperly/issues/364)) ([7e1cb8f](https://github.com/riok/mapperly/commit/7e1cb8fcf1331a62e775528163ec8e5a4af7865d))
* ignore static fields and properties ([#380](https://github.com/riok/mapperly/issues/380)) ([e5e2d1c](https://github.com/riok/mapperly/commit/e5e2d1c41ac265d4d06678c6ccf052bc343437e5))
* insert a cast to idictionary when an explicit setter is present ([#341](https://github.com/riok/mapperly/issues/341)) ([20f6f06](https://github.com/riok/mapperly/commit/20f6f0623b6d0735167560c9764a54d24598b861))
* prevent crash when object to object mapping ([#340](https://github.com/riok/mapperly/issues/340)) ([b5f4559](https://github.com/riok/mapperly/commit/b5f4559cc0547662e7080323c86e9f4ac68168e7))
### Features
* add EnsureCapacity method generation ([#312](https://github.com/riok/mapperly/issues/312)) ([c166a3f](https://github.com/riok/mapperly/commit/c166a3f17fd56b95f5b37638b08ab45dcc0c51a1))
* add EnsureCapacity to dctionary foreach loops ([#361](https://github.com/riok/mapperly/issues/361)) ([685d6ee](https://github.com/riok/mapperly/commit/685d6ee1e30c753bffa26ffeb5f066c495ea08e7))
* add mapping to immutable sequences ([#305](https://github.com/riok/mapperly/issues/305)) ([8c8a338](https://github.com/riok/mapperly/commit/8c8a338ee6707a33716a3e53d56b6642d77a7393))
* add queue and stack mapping ([#297](https://github.com/riok/mapperly/issues/297)) ([5040bf5](https://github.com/riok/mapperly/commit/5040bf516ba636292c4269500ff52c7f3254ca13))
* add support fot and ([#351](https://github.com/riok/mapperly/issues/351)) ([587abbc](https://github.com/riok/mapperly/commit/587abbc00560da242d0cd117e85117d0ca1f547a))
* queryable support for user implemented mappings ([#348](https://github.com/riok/mapperly/issues/348)) ([a58f56f](https://github.com/riok/mapperly/commit/a58f56f5305034d53041226aab92ad338fb34456))
* support fields ([d2fe807](https://github.com/riok/mapperly/commit/d2fe8074d47f5ce4fe0f0fe4d922383c3ff0109f))
* support immutable interfaced target types ([#365](https://github.com/riok/mapperly/issues/365)) ([fea8aa3](https://github.com/riok/mapperly/commit/fea8aa396d4b5f53a896f4236e2fb438731b1599))
* Support IQueryable projection mappings ([#287](https://github.com/riok/mapperly/issues/287)) ([c2a338f](https://github.com/riok/mapperly/commit/c2a338fa91ca8bfc761d20ac8ceb9a553dc45846))
* support mappers nested in classes ([#354](https://github.com/riok/mapperly/issues/354)) ([80a193a](https://github.com/riok/mapperly/commit/80a193ac8ca6e073c3b320d8b148a58c8ee6c68f))
* use IEnumerable constructors where possible ([#342](https://github.com/riok/mapperly/issues/342)) ([74d0b52](https://github.com/riok/mapperly/commit/74d0b52af6e62bd7ffe1e7fe85bea335736640de))
* use instead of ([#327](https://github.com/riok/mapperly/issues/327)) ([3b9c2f9](https://github.com/riok/mapperly/commit/3b9c2f9cb0e3fe4e969d4f2991135f2e5aab00d8))