Franz.Common.Mapping 1.5.4

There is a newer version of this package available.
See the version list below for details.
dotnet add package Franz.Common.Mapping --version 1.5.4
                    
NuGet\Install-Package Franz.Common.Mapping -Version 1.5.4
                    
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.5.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Franz.Common.Mapping" Version="1.5.4" />
                    
Directory.Packages.props
<PackageReference Include="Franz.Common.Mapping" />
                    
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 Franz.Common.Mapping --version 1.5.4
                    
#r "nuget: Franz.Common.Mapping, 1.5.4"
                    
#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.5.4
                    
#: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.5.4
                    
Install as a Cake Addin
#tool nuget:?package=Franz.Common.Mapping&version=1.5.4
                    
Install as a Cake Tool

Franz.Common.Mapping

A lightweight, fast, and extensible object mapping library for the Franz ecosystem.

Current Version: 1.5.4


?? 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, and Ignore.
  • ?? Configurable via DI (AddFranzMapping).
  • ?? Expression-based mapping (fast, cached, reflection-minimal).
  • ?? Extendable with custom converters and profiles.

?? Installation

dotnet add package Franz.Common.Mapping --version 1.5.1

?? Quick Start

1. Define a Profile

using Franz.Common.Mapping.Core;
using Franz.Common.Mapping.Profiles;

public ApplicationProfile()
        {
            // Book <-> BookDto
            CreateMap<Book, BookDto>()
                .ForMember(dest => dest.Isbn, opt => opt.MapFrom(src => src.Isbn.Value))
                .ForMember(dest => dest.Title, opt => opt.MapFrom(src => src.Title.Value))
                .ForMember(dest => dest.Author, opt => opt.MapFrom(src => src.Author.Value))
                .ForMember(dest => dest.PublishedOn, opt => opt.MapFrom(src => src.PublishedOn))
                .ForMember(dest => dest.CopiesAvailable, opt => opt.MapFrom(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, opt => opt.MapFrom(src => src.Name.Value))
                .ForMember(dest => dest.Email, opt => opt.MapFrom(src => src.Email.Value))
                .ForMember(dest => dest.BorrowedBooksCount, opt => opt.MapFrom(src => src.BorrowedBooks.Count))
                .ReverseMap()
                .ConstructUsing(dto => new Member(
                    new FullName(dto.FullName),
                    new Email(dto.Email)
                ));
        }
    }

public class Book 
{ 
    public string Name { get; set; } = ""; 
    public string Isbn { get; set; } = ""; 
}

public class BookDto 
{ 
    public string Title { get; set; } = ""; 
    public string ISBN { get; set; } = ""; 
    public string SecretNotes { get; set; } = ""; 
}

2. Register in DI

services.AddAutoMapper(
            config => { }, // no extra config needed
            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.
  • ? 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 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.

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 115 3/30/2026
2.0.1 112 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