DeltaMapper 1.2.0
dotnet add package DeltaMapper --version 1.2.0
NuGet\Install-Package DeltaMapper -Version 1.2.0
<PackageReference Include="DeltaMapper" Version="1.2.0" />
<PackageVersion Include="DeltaMapper" Version="1.2.0" />
<PackageReference Include="DeltaMapper" />
paket add DeltaMapper --version 1.2.0
#r "nuget: DeltaMapper, 1.2.0"
#:package DeltaMapper@1.2.0
#addin nuget:?package=DeltaMapper&version=1.2.0
#tool nuget:?package=DeltaMapper&version=1.2.0
DeltaMapper
Fast, diff-aware .NET object mapper. MIT licensed. Minimal dependencies.
Why DeltaMapper?
- Near-zero overhead — source-generated direct calls run at 7 ns, same as hand-written code
MappingDiff<T>— map and get a structured change set in one call- Source generator —
[GenerateMap]emits assignment code at build time, zero reflection;[IgnoreMember],[MapMember], and[NullSubstitute]attributes customize maps without runtime Profiles - Full IMapper pipeline — DI, middleware, hooks, EF Core proxy detection, OpenTelemetry tracing
ProjectTo<T>()— translate profile maps into EF Core-compatible SQL projections viaIQueryable
Install
dotnet add package DeltaMapper # core runtime
dotnet add package DeltaMapper.SourceGen # optional: compile-time codegen
dotnet add package DeltaMapper.EFCore # optional: EF Core proxy awareness + ProjectTo
dotnet add package DeltaMapper.OpenTelemetry # optional: Activity spans
Requires .NET 8+ (binaries for net8.0, net9.0, and net10.0).
Quick Start
public class UserProfile : Profile
{
public UserProfile()
{
CreateMap<User, UserDto>()
.ForMember(d => d.FullName, o => o.MapFrom(s => $"{s.First} {s.Last}"))
.ReverseMap();
}
}
var mapper = MapperConfiguration.Create(cfg => cfg.AddProfile<UserProfile>())
.CreateMapper();
var dto = mapper.Map<User, UserDto>(user);
Built-in Change Tracking
var diff = mapper.Patch(updateDto, existingUser);
if (diff.HasChanges)
await auditLog.RecordAsync(userId, diff.Changes);
EF Core ProjectTo
Project directly from an IQueryable to a DTO — EF Core translates the mapping expression to SQL.
var config = MapperConfiguration.Create(cfg => cfg.AddProfile<OrderProfile>());
var dtos = await dbContext.Orders
.Where(o => o.IsActive)
.ProjectTo<Order, OrderDto>(config)
.ToListAsync();
Flattening and Unflattening
Nested objects are flattened to flat DTOs and back automatically — no configuration required.
// Order.Customer.Name → CustomerName (flattening)
CreateMap<Order, OrderFlatDto>();
// CustomerName → Customer.Name (unflattening)
CreateMap<OrderFlatDto, Order>();
Assembly Scanning
// Register all profiles in an assembly in one call
cfg.AddProfilesFromAssemblyContaining<UserProfile>();
Type Converters
// Apply a conversion across every map that has a matching type pair
cfg.CreateTypeConverter<string, DateTime>(s => DateTime.Parse(s));
Conditional Mapping
// Skip mapping a property when a condition is not met
CreateMap<Order, OrderDto>()
.ForMember(d => d.Discount, o => o.Condition(s => s.IsPremiumCustomer));
Source Generator Attributes
Customize compile-time maps with attributes on the partial profile class — no runtime Profile required.
[GenerateMap(typeof(User), typeof(UserDto))]
[IgnoreMember(typeof(User), typeof(UserDto), nameof(UserDto.InternalId))]
[MapMember(typeof(User), typeof(UserDto), nameof(UserDto.FullName), nameof(User.Name))]
[NullSubstitute(typeof(User), typeof(UserDto), nameof(UserDto.DisplayName), "Anonymous")]
public partial class UserMappingProfile { }
| Attribute | Effect |
|---|---|
[IgnoreMember(src, dst, member)] |
Exclude a destination member from the generated map |
[MapMember(src, dst, dstMember, srcMember)] |
Map a source member to a differently named destination member |
[NullSubstitute(src, dst, member, value)] |
Use value when the source member is null |
Requires DeltaMapper.SourceGen.
Performance
| What's being mapped | DeltaMapper | vs Mapperly | vs AutoMapper |
|---|---|---|---|
| Simple object (5 properties) | 7 ns | Same speed | 7x faster |
| Nested object (parent + child) | 24 ns | Same speed, 33% less memory | 2x faster |
| Collection (10 items) | 22 ns | 5x faster, 8x less memory | 8x faster |
Getting Help
- GitHub Issues — bug reports and feature requests
- GitHub Discussions — questions
Links
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. 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
-
net8.0
-
net9.0
NuGet packages (2)
Showing the top 2 NuGet packages that depend on DeltaMapper:
| Package | Downloads |
|---|---|
|
DeltaMapper.EFCore
EF Core integration for DeltaMapper — ProjectTo IQueryable projections and proxy-aware middleware |
|
|
DeltaMapper.OpenTelemetry
OpenTelemetry tracing middleware for DeltaMapper — emits Activity spans for every mapping operation |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.2.0 | 478 | 4/7/2026 |
| 1.1.0 | 133 | 4/6/2026 |
| 1.0.0 | 287 | 4/2/2026 |
| 1.0.0-rc.8 | 78 | 3/23/2026 |
| 1.0.0-rc.7 | 78 | 3/21/2026 |
| 1.0.0-rc.6 | 57 | 3/21/2026 |
| 1.0.0-rc.5 | 58 | 3/21/2026 |
| 1.0.0-rc.4 | 60 | 3/20/2026 |
| 1.0.0-rc.3 | 60 | 3/20/2026 |
| 1.0.0-rc.2 | 56 | 3/20/2026 |
| 1.0.0-rc.1 | 65 | 3/19/2026 |
| 0.2.0-alpha | 109 | 3/19/2026 |
| 0.1.0-alpha | 109 | 3/18/2026 |
v1.0.0 — First stable release. See CHANGELOG.md for full feature list.