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
<PackageReference Include="Franz.Common.Mapping" Version="3.0.0" />
<PackageVersion Include="Franz.Common.Mapping" Version="3.0.0" />
<PackageReference Include="Franz.Common.Mapping" />
paket add Franz.Common.Mapping --version 3.0.0
#r "nuget: Franz.Common.Mapping, 3.0.0"
#:package Franz.Common.Mapping@3.0.0
#addin nuget:?package=Franz.Common.Mapping&version=3.0.0
#tool nuget:?package=Franz.Common.Mapping&version=3.0.0
Franz.Common.Mapping
Configurable runtime mapping plus strongly typed mapping contracts for application and domain models.
Overview
The package exposes two distinct mapping paths:
IFranzMapper/IMappingService: a runtime mapper driven byMappingConfigurationandIFranzMapProfile.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 | Versions 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. |
-
net10.0
- Franz.Common.Errors (>= 3.0.0)
- Franz.Common.Reflection (>= 3.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.14)
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 |