Franz.Common.Mapping 1.7.2

dotnet add package Franz.Common.Mapping --version 1.7.2
                    
NuGet\Install-Package Franz.Common.Mapping -Version 1.7.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.7.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.7.2" />
                    
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.7.2
                    
#r "nuget: Franz.Common.Mapping, 1.7.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.7.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.7.2
                    
Install as a Cake Addin
#tool nuget:?package=Franz.Common.Mapping&version=1.7.2
                    
Install as a Cake Tool

Perfect β€” this README is already clean, but with your new constructor-aware, record-friendly mapper, we can evolve it for Franz.Common.Mapping 1.6.19 and showcase the architectural jump you just built.

Here’s the updated README draft (in your project’s tone and formatting):


Franz.Common.Mapping

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

Current Version: 1.7.2 Codename: Constructor-Aware Evolution

  • Part of the private Franz Framework ecosystem.

🌐 Overview

Franz.Common.Mapping is an AutoMapper++ alternative β€” type-safe, DI-friendly, and seamlessly integrated into the Franz Framework. It now features record-aware, constructor-smart mapping, allowing pure immutable DTOs and records without any public parameterless constructors.

It provides:

  • ⚑ Simple by-name mapping out of the box.
  • πŸ“‘ Profiles with CreateMap, ForMember, Ignore, ReverseMap, and ConstructUsing.
  • πŸ”§ DI-friendly configuration with AddFranzMapping.
  • 🧠 Constructor-aware instantiation (auto-detects record positional constructors).
  • 🏎 Expression-based mapping (fast, cached, reflection-minimal).
  • 🧩 Extendable with custom converters and profiles.
  • πŸ›  Assembly scanning for automatic profile registration (β‰₯ 1.5.9).

πŸ“¦ Installation

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

πŸš€ Quick Start

1. Define a Profile

using Franz.Common.Mapping.Core;

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)
            .ReverseMap()
            .ConstructUsing(dto => new Book(
                new ISBN(dto.Isbn),
                new Title(dto.Title),
                new Author(dto.Author)
            ));

        // Member ↔ MemberDto (record-friendly)
        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

services.AddFranzMapping(Assembly.GetExecutingAssembly());

or inline:

services.AddFranzMapping(cfg =>
{
    cfg.CreateMap<Foo, Bar>();
}, Assembly.GetExecutingAssembly());

3. Use the Mapper

var mapper = provider.GetRequiredService<IFranzMapper>();

var member = new Member(new FullName("John Doe"), new Email("john@acme.com"));
var dto = mapper.Map<Member, MemberDto>(member);

Console.WriteLine(dto.FullName); // John Doe
Console.WriteLine(dto.Email);    // john@acme.com

Version 1.6.20

  • Updated to .NET 10.0

✨ New in 1.6.19

🧠 Constructor-Aware Mapping Engine

  • Detects and invokes record positional constructors automatically.
  • Eliminates the need for public MemberDto() { }.
  • Allows immutable DTOs and record structs out-of-the-box.
  • Falls back to Activator.CreateInstance() only when no usable constructor exists.
  • 100 % backward-compatible with ConstructUsing() and legacy mappings.

🧩 Architectural Impact

  • Strengthens immutability and contract integrity in the Franz ecosystem.
  • Enables the β€œDTOs must be immutable” Tribunal rule to pass naturally.
  • Outperforms AutoMapper in instantiation efficiency and architectural compliance.

🧩 Features Summary

  • πŸ”„ By-name mapping fallback (zero config).
  • 🎯 Profiles for explicit control.
  • πŸ›  ForMember / Ignore / ConstructUsing API.
  • πŸ’Ύ Immutable, cached mapping expressions.
  • 🧩 Dependency Injection integration.
  • πŸ” Assembly scanning for auto-profile discovery.
  • 🧠 Record-friendly smart instantiation.
  • βœ… Tested in the Franz Book & Library APIs for production stability.

πŸ›£ Roadmap

  • πŸ”Œ Custom type converters (ITypeConverter<TSource, TDest>).
  • ⏳ Async mapping support for I/O-heavy scenarios.
  • 🚨 Startup validation (fail-fast if mappings incomplete).
  • 🧩 Expression caching for constructor binding.
  • πŸ§‘β€πŸ’» Roslyn analyzers to detect missing profiles at compile time.

πŸ“œ License

MIT β€” free to use, modify, and distribute.


Would you like me to also generate the matching CHANGELOG.md entry for 1.6.19 in your Franz release format (with version header, bullet evolution notes, and commit tag)?

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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.AzureEventGrid

Shared utility library for the Franz Framework.

Franz.Common.Messaging.AzureEventBus

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
1.7.2 15 12/21/2025
1.7.1 59 12/20/2025
1.7.0 259 12/16/2025
1.6.21 171 11/27/2025
1.6.20 180 11/24/2025
1.6.19 134 10/25/2025
1.6.15 171 10/20/2025
1.6.14 169 10/15/2025
1.6.3 176 10/9/2025
1.6.2 182 10/7/2025
1.5.9 182 9/24/2025
1.5.4 178 9/23/2025
1.5.3 222 9/21/2025
1.5.2 393 9/21/2025