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
<PackageReference Include="Franz.Common.Mapping" Version="1.7.2" />
<PackageVersion Include="Franz.Common.Mapping" Version="1.7.2" />
<PackageReference Include="Franz.Common.Mapping" />
paket add Franz.Common.Mapping --version 1.7.2
#r "nuget: Franz.Common.Mapping, 1.7.2"
#:package Franz.Common.Mapping@1.7.2
#addin nuget:?package=Franz.Common.Mapping&version=1.7.2
#tool nuget:?package=Franz.Common.Mapping&version=1.7.2
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, andConstructUsing. - π§ 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 | 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 (>= 1.7.2)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.0)
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 |