Franz.Common.Mapping
2.3.4
dotnet add package Franz.Common.Mapping --version 2.3.4
NuGet\Install-Package Franz.Common.Mapping -Version 2.3.4
<PackageReference Include="Franz.Common.Mapping" Version="2.3.4" />
<PackageVersion Include="Franz.Common.Mapping" Version="2.3.4" />
<PackageReference Include="Franz.Common.Mapping" />
paket add Franz.Common.Mapping --version 2.3.4
#r "nuget: Franz.Common.Mapping, 2.3.4"
#:package Franz.Common.Mapping@2.3.4
#addin nuget:?package=Franz.Common.Mapping&version=2.3.4
#tool nuget:?package=Franz.Common.Mapping&version=2.3.4
Franz.Common.Mapping
Object mapping for the Franz.Common framework on .NET 10.
Overview
The Franz.Common.Mapping package provides object mapping within Franz.Common. It is designed to compose with the rest of the framework rather than imposing unrelated infrastructure choices on every application.
Installation
dotnet add package Franz.Common.Mapping
Design principles
- Explicit composition: register only the capabilities the application needs.
- Clear boundaries: keep domain and application contracts independent from provider-specific infrastructure where the package's role permits it.
- Predictable behavior: make configuration, failure modes, and lifecycle ownership visible rather than relying on hidden conventions.
- Operational readiness: validate security, resilience, diagnostics, and compatibility for the actual deployment environment.
Usage and configuration
Follow the package-specific setup, configuration, and code examples below. Only configure external services when this package requires them, and keep secrets outside source control.
Package-specific guide
A deterministic, high-performance object mapping engine for the Franz Framework.
- Current Version: v2.3.4
- Codename: Mapping Engine Formalization & Constructor-Aware Evolution
- Part of the Franz Core Infrastructure Suite
π Overview
Franz.Common.Mapping is a deterministic object mapping engine, designed to replace traditional βmagic mappersβ with a strict, explicit execution model.
It is built around a single principle:
Mapping is not inference β it is execution over declared intent.
This version formalizes the engine into a three-layer architecture:
- Configuration Layer β mapping intent (profiles & expressions)
- Execution Engine β deterministic transformation (FranzMapper)
- Service Layer β DI-safe orchestration (MappingService)
π§ Core Architectural Upgrade (v2.2.2)
πΉ Mapping Engine Formalization
- Reframed the system into a deterministic mapping execution pipeline
- Removed ambiguity from implicit mapping behavior
- Standardized execution order across all mappings
Execution Pipeline Order:
- Circular reference detection (graph safety guard)
- Value-object unwrapping (
Valuepattern resolution) - Collection mapping (generic enumerable handling)
- Configured mappings (MappingConfiguration lookup)
- Constructor-based projection (
ConstructUsing) - Property-based fallback mapping
π Architecture Separation
1. Configuration Layer (Mapping Intent)
- All mappings are explicitly registered
- No automatic or implicit discovery of mappings
- Deterministic override behavior: last registration wins
config.Register(new MappingExpression<User, UserDto>()
.ConstructUsing(u => new UserDto { Name = u.Name }));
2. Execution Engine (FranzMapper)
The FranzMapper is a pure execution engine responsible for applying mapping rules.
Key Responsibilities:
- Graph traversal and safety control
- Constructor resolution (including record types)
- Property binding execution
- Collection transformation
- Value-object unwrapping
- Fallback mapping logic
π§± Constructor-Aware Mapping (NEW in v2.2.2)
πΉ Record & Immutable Type Support
The engine now natively supports:
- C# records (positional constructors)
- Immutable DTOs
- Constructor-only types
Behavior:
- Automatically detects the best constructor
- Binds constructor parameters from source properties
- Supports
ConstructUsingoverrides - Falls back to reflection-based instantiation only when necessary
CreateMap<User, UserDto>()
.ConstructUsing(u => new UserDto(u.Name, u.Email));
Architectural Impact:
- Eliminates dependency on parameterless constructors
- Enables fully immutable DTO designs
- Aligns mapping with domain-driven design principles
π Value Object Unwrapping System
New deterministic unwrapping model:
The engine automatically resolves wrapped values:
class WrappedInt
{
public int Value { get; set; }
}
Mapping:
WrappedInt β int
Rules:
- Extracts
Valueproperty automatically - Applies scalar conversion rules before mapping
- Preserves type safety when compatible
- Falls back to full mapping engine if needed
π¦ Collection Mapping Engine
Fully supports:
- Lists
- Enumerables
- Arrays
Element mapping is recursive and pipeline-consistent
Uses cached delegate dispatch for performance optimization
π Circular Reference Protection
- Built-in graph traversal tracking
- Prevents infinite recursion in object graphs
- Uses reference-equality tracking for accuracy
Behavior:
TechnicalException: Circular mapping detected
βοΈ Performance Model
The framework is optimized for:
- Minimal reflection in hot paths
- Cached constructor and property resolution
- Compiled delegate dispatch for recursive mappings
- Allocation-efficient collection handling
π§© Mapping Service (DI Layer)
A lightweight orchestration layer over the engine.
Responsibilities:
- Dependency injection integration
- Safe lifecycle management
- Async-compatible API surface
var dto = service.Map<User, UserDto>(user);
Async Behavior:
- Mapping remains CPU-bound
- Async API is a compatibility and composition layer
- No hidden concurrency introduced by default
βοΈ Design Guarantees
Franz Mapping guarantees:
- Deterministic output for identical inputs
- No hidden runtime discovery of mappings
- Thread-safe execution
- Strict separation of configuration and execution
- Predictable graph traversal semantics
π§ Design Philosophy
βMapping is not inference. It is a deterministic execution graph over explicit intent.β
π Version Highlights (v2.2.2)
β¨ Major Changes
- Formalized mapping engine execution pipeline
- Introduced constructor-aware mapping (records supported natively)
- Strengthened value-object unwrapping system
- Standardized circular reference detection
- Unified mapping resolution order across all execution paths
βοΈ Internal Improvements
- Reduced reflection dependency in runtime mapping
- Improved constructor resolution logic
- Stabilized collection mapping pipeline
- Improved DI service consistency and lifecycle safety
Dependency maintenance β October 2026
This project's dependency references were reviewed and updated as part of the repository-wide .NET 10 maintenance pass. The intended target framework and public API remain unchanged. Verify the resolved direct and transitive dependency graph through the repository's dependency validation workflow before publishing. See the central dependency upgrade record.
| 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 (>= 2.3.4)
- Franz.Common.Reflection (>= 2.3.4)
- 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 |
|---|---|---|
| 2.3.4 | 75 | 11/1/2026 |
| 2.3.3 | 240 | 10/28/2026 |
| 2.3.2 | 113 | 10/27/2026 |
| 2.3.1 | 186 | 10/26/2026 |
| 2.3.0 | 219 | 7/21/2026 |
| 2.2.19 | 166 | 7/19/2026 |
| 2.2.18 | 170 | 7/19/2026 |
| 2.2.17 | 165 | 7/12/2026 |
| 2.2.16 | 278 | 7/2/2026 |
| 2.2.15 | 171 | 6/29/2026 |
| 2.2.14 | 167 | 6/29/2026 |
| 2.2.13 | 171 | 6/29/2026 |
| 2.2.12 | 163 | 6/28/2026 |
| 2.2.11 | 167 | 6/28/2026 |
| 2.2.10 | 160 | 6/28/2026 |
| 2.2.9 | 175 | 6/28/2026 |
| 2.2.8 | 168 | 6/28/2026 |
| 2.2.7 | 178 | 6/7/2026 |
| 2.2.6 | 176 | 6/6/2026 |
| 2.2.5 | 190 | 6/4/2026 |