Franz.Common.Mapping 3.0.0

dotnet add package Franz.Common.Mapping --version 3.0.0
                    
NuGet\Install-Package Franz.Common.Mapping -Version 3.0.0
                    
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="3.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Franz.Common.Mapping" Version="3.0.0" />
                    
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 3.0.0
                    
#r "nuget: Franz.Common.Mapping, 3.0.0"
                    
#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@3.0.0
                    
#: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=3.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Franz.Common.Mapping&version=3.0.0
                    
Install as a Cake Tool

Franz.Common.Mapping

Configurable runtime mapping plus strongly typed mapping contracts for application and domain models.

Overview

The package exposes two distinct mapping paths:

  1. IFranzMapper/IMappingService: a runtime mapper driven by MappingConfiguration and IFranzMapProfile.
  2. IMapper<TSource, TDestination>: a strongly typed contract implemented by the companion incremental source generator.

These paths have different trimming and Native AOT characteristics.

Installation

dotnet add package Franz.Common.Mapping

The mapping generator is included as an analyzer dependency of the package.

Runtime mapper registration

using Franz.Common.Mapping.Extensions;

builder.Services.AddFranzMapping(
    assemblies: new[] { typeof(CustomerMapProfile).Assembly });

The extension registers MappingConfiguration, IFranzMapper, and IMappingService. It discovers concrete IFranzMapProfile implementations in the supplied assemblies; when no assemblies are supplied, it scans matching assemblies loaded in the current AppDomain. This profile discovery uses reflection and dynamic activation and is annotated as trimming/Native AOT incompatible.

Profiles and expressions

Derive a profile from FranzMapProfile and declare mappings through CreateMap<TSource, TDestination>():

public sealed class CustomerMapProfile : FranzMapProfile
{
    public CustomerMapProfile()
    {
        CreateMap<Customer, CustomerDto>()
            .ForMember(destination => destination.DisplayName, source => source.Name)
            .Ignore(destination => destination.InternalCode)
            .Strict();
    }
}

The expression API supports:

  • ForMember(destination, source) for direct property-to-property bindings.
  • Ignore(destination) to skip a destination member.
  • ConstructUsing(Func<TSource, TDestination>) or the mapper-aware overload.
  • ReverseConstructUsing(...) stores a reverse constructor delegate in the expression. The current runtime mapper does not consume that delegate or expose automatic reverse mapping.
  • Strict() to fail when required source members/constructor parameters cannot be resolved.

Mappings are registered by source/destination type pair; a later registration for the same pair replaces the previous expression.

Runtime behavior

The runtime mapper supports constructor-based destination creation, explicit constructor selection through [MapConstructor], member bindings, ignored members, collection mapping, and [ValueObject] unwrapping. It detects circular object graphs and fails with a technical mapping exception.

IMappingService.MapAsync is a compatibility/composition API that returns a ValueTask; mapping remains CPU-bound and is not moved to a background thread.

Native AOT

The reflection-based IFranzMapper and profile-discovery registration are not Native AOT-safe. For trimming and Native AOT, use a generated IMapper<TSource, TDestination> implementation from the companion source generator and call its typed Map method directly. See Franz.Common.Mapping.Generators.

License

MIT. See the repository LICENSE.

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.AzureEventBus

Shared utility library for the Franz Framework.

Franz.Common.Messaging.AzureEventHubs

Shared utility library for the Franz Framework.

Franz.Common.Messaging.AzureEventGrid

Shared utility library for the Franz Framework.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.0.0 51 11/10/2026
2.3.4 382 11/1/2026
2.3.3 268 10/28/2026
2.3.2 139 10/27/2026
2.3.1 192 10/26/2026
2.3.0 225 7/21/2026
2.2.19 169 7/19/2026
2.2.18 173 7/19/2026
2.2.17 168 7/12/2026
2.2.16 281 7/2/2026
2.2.15 174 6/29/2026
2.2.14 169 6/29/2026
2.2.13 176 6/29/2026
2.2.12 166 6/28/2026
2.2.11 170 6/28/2026
2.2.10 165 6/28/2026
2.2.9 178 6/28/2026
2.2.8 171 6/28/2026
2.2.7 181 6/7/2026
2.2.6 179 6/6/2026
Loading failed