Franz.Common.Mapping
2.2.7
dotnet add package Franz.Common.Mapping --version 2.2.7
NuGet\Install-Package Franz.Common.Mapping -Version 2.2.7
<PackageReference Include="Franz.Common.Mapping" Version="2.2.7" />
<PackageVersion Include="Franz.Common.Mapping" Version="2.2.7" />
<PackageReference Include="Franz.Common.Mapping" />
paket add Franz.Common.Mapping --version 2.2.7
#r "nuget: Franz.Common.Mapping, 2.2.7"
#:package Franz.Common.Mapping@2.2.7
#addin nuget:?package=Franz.Common.Mapping&version=2.2.7
#tool nuget:?package=Franz.Common.Mapping&version=2.2.7
Franz.Common.Mapping
A deterministic, high-performance object mapping engine for the Franz Framework.
- Current Version: v2.2.7
- 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
| 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.2.7)
- Franz.Common.Reflection (>= 2.2.7)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.8)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on Franz.Common.Mapping:
| Package | Downloads |
|---|---|
|
Franz.Common.Messaging.AzureEventHubs
Shared utility library for the Franz Framework. |
|
|
Franz.Common.Messaging.AzureEventBus
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.2.7 | 135 | 6/7/2026 |
| 2.2.6 | 134 | 6/6/2026 |
| 2.2.5 | 138 | 6/4/2026 |
| 2.2.4 | 122 | 6/3/2026 |
| 2.2.3 | 133 | 6/2/2026 |
| 2.2.2 | 134 | 6/2/2026 |
| 2.2.1 | 138 | 5/24/2026 |
| 2.1.4 | 134 | 4/27/2026 |
| 2.1.3 | 132 | 4/26/2026 |
| 2.1.2 | 130 | 4/26/2026 |
| 2.1.1 | 140 | 4/22/2026 |
| 2.0.2 | 144 | 3/30/2026 |
| 2.0.1 | 142 | 3/29/2026 |
| 1.7.8 | 144 | 3/2/2026 |
| 1.7.7 | 154 | 1/31/2026 |
| 1.7.6 | 153 | 1/22/2026 |
| 1.7.5 | 147 | 1/10/2026 |
| 1.7.4 | 150 | 12/27/2025 |
| 1.7.3 | 236 | 12/22/2025 |
| 1.7.2 | 225 | 12/21/2025 |