Franz.Common.Mapping
1.6.2
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Franz.Common.Mapping --version 1.6.2
NuGet\Install-Package Franz.Common.Mapping -Version 1.6.2
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="Franz.Common.Mapping" Version="1.6.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Franz.Common.Mapping" Version="1.6.2" />
<PackageReference Include="Franz.Common.Mapping" />
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 Franz.Common.Mapping --version 1.6.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Franz.Common.Mapping, 1.6.2"
#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 Franz.Common.Mapping@1.6.2
#: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=Franz.Common.Mapping&version=1.6.2
#tool nuget:?package=Franz.Common.Mapping&version=1.6.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Franz.Common.Mapping
A lightweight, fast, and extensible object mapping library for the Franz ecosystem.
Current Version: 1.5.9
🌐 Overview
Franz.Common.Mapping is designed as an AutoMapper++ alternative — type-safe, DI-friendly, and integrated with the Franz Framework.
It provides:
- ⚡ Simple by-name mapping out of the box.
- 📑 Profiles with
CreateMap,ForMember,Ignore,ReverseMap, andConstructUsing. - 🔧 Configurable via DI with
AddFranzMapping. - 🏎 Expression-based mapping (fast, cached, reflection-minimal).
- 🧩 Extendable with custom converters and profiles.
- 🛠 Assembly scanning for automatic profile registration (new in
1.5.9).
📦 Installation
dotnet add package Franz.Common.Mapping --version 1.5.9
🚀 Quick Start
1. Define a Profile
using Franz.Common.Mapping.Core;
using Franz.Common.Mapping.Profiles;
public class ApplicationProfile : FranzMapProfile
{
public ApplicationProfile()
{
// Book <-> BookDto
CreateMap<Book, BookDto>()
.ForMember(dest => dest.Isbn, src => src.Isbn.Value)
.ForMember(dest => dest.Title, src => src.Title.Value)
.ForMember(dest => dest.Author, src => src.Author.Value)
.ForMember(dest => dest.PublishedOn, src => src.PublishedOn)
.ForMember(dest => dest.CopiesAvailable, src => src.CopiesAvailable)
.ReverseMap()
.ConstructUsing(dto => new Book(
new ISBN(dto.Isbn),
new Title(dto.Title),
new Author(dto.Author),
dto.PublishedOn,
dto.CopiesAvailable
));
// Member <-> MemberDto
CreateMap<Member, MemberDto>()
.ForMember(dest => dest.FullName, src => src.Name.Value)
.ForMember(dest => dest.Email, src => src.Email.Value)
.ForMember(dest => dest.BorrowedBooksCount, src => src.BorrowedBooks.Count)
.ReverseMap()
.ConstructUsing(dto => new Member(
new FullName(dto.FullName),
new Email(dto.Email)
));
}
}
2. Register in DI
Assembly scanning (recommended, new in 1.5.9):
services.AddFranzMapping(Assembly.GetExecutingAssembly());
Inline + assemblies:
services.AddFranzMapping(cfg =>
{
cfg.CreateMap<Foo, Bar>();
}, Assembly.GetExecutingAssembly());
3. Use the Mapper
var mapper = provider.GetRequiredService<IFranzMapper>();
var book = new Book { Name = "The Hobbit", Isbn = "978-0261103344" };
var dto = mapper.Map<Book, BookDto>(book);
Console.WriteLine(dto.Title); // "The Hobbit"
Console.WriteLine(dto.Isbn); // "978-0261103344"
✨ Features
- 🔄 By-name mapping fallback (zero config).
- 🎯 Profiles for explicit control.
- 🛠 ForMember & Ignore API.
- 💾 Immutable, cached mapping expressions for performance.
- 🧩 DI integration with
AddFranzMapping. - 🔍 Assembly scanning for auto-discovery of profiles.
- ✅ Tested in the Franz Book API to ensure real-world readiness.
🛣 Roadmap
- 🔌 Custom type converters (
ITypeConverter<TSource, TDest>). - ⏳ Async mapping support for I/O-heavy scenarios.
- 🚨 Startup validation (fail-fast if mappings are incomplete).
- 🧑💻 Roslyn analyzers to catch missing profiles at compile time.
📜 License
MIT — free to use, modify, and distribute.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net9.0
- Franz.Common.Errors (>= 1.6.2)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.9)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on Franz.Common.Mapping:
| Package | Downloads |
|---|---|
|
Franz.Common.Messaging.AzureEventBus
Shared utility library for the Franz Framework. |
|
|
Franz.Common.Messaging.AzureEventGrid
Shared utility library for the Franz Framework. |
|
|
Franz.Common.Messaging.AzureEventHubs
Shared utility library for the Franz Framework. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.0.2 | 113 | 3/30/2026 |
| 2.0.1 | 111 | 3/29/2026 |
| 1.7.8 | 123 | 3/2/2026 |
| 1.7.7 | 134 | 1/31/2026 |
| 1.7.6 | 130 | 1/22/2026 |
| 1.7.5 | 126 | 1/10/2026 |
| 1.7.4 | 136 | 12/27/2025 |
| 1.7.3 | 218 | 12/22/2025 |
| 1.7.2 | 209 | 12/21/2025 |
| 1.7.1 | 153 | 12/20/2025 |
| 1.7.0 | 324 | 12/16/2025 |
| 1.6.21 | 204 | 11/27/2025 |
| 1.6.20 | 214 | 11/24/2025 |
| 1.6.19 | 158 | 10/25/2025 |
| 1.6.15 | 202 | 10/20/2025 |
| 1.6.14 | 180 | 10/15/2025 |
| 1.6.3 | 206 | 10/9/2025 |
| 1.6.2 | 209 | 10/7/2025 |
| 1.5.9 | 212 | 9/24/2025 |
| 1.5.4 | 203 | 9/23/2025 |
Loading failed