ForgeMap 1.7.0
dotnet add package ForgeMap --version 1.7.0
NuGet\Install-Package ForgeMap -Version 1.7.0
<PackageReference Include="ForgeMap" Version="1.7.0" />
<PackageVersion Include="ForgeMap" Version="1.7.0" />
<PackageReference Include="ForgeMap" />
paket add ForgeMap --version 1.7.0
#r "nuget: ForgeMap, 1.7.0"
#:package ForgeMap@1.7.0
#addin nuget:?package=ForgeMap&version=1.7.0
#tool nuget:?package=ForgeMap&version=1.7.0
ForgeMap
A lightweight, MIT-licensed, source-generator-based object transformation library for .NET. ForgeMap generates type conversion code at compile time, providing zero-reflection runtime execution with compile-time type safety.
Features
- Source Generator - Compile-time code generation, no runtime reflection
- Zero Overhead - Generated code is as fast as hand-written code
- Type Safe - Compile-time validation of mappings
- Debuggable - Generated code is readable and debuggable
- MIT License - Fully open source, no commercial restrictions
Installation
dotnet add package ForgeMap
Quick Start
using ForgeMap;
// 1. Define your types
public class OrderEntity
{
public string Id { get; set; }
public string CustomerName { get; set; }
public DateTime OrderDate { get; set; }
}
public class OrderDto
{
public string Id { get; set; }
public string CustomerName { get; set; }
public DateTime OrderDate { get; set; }
}
// 2. Create a forger class
[ForgeMap]
public partial class AppForger
{
public partial OrderDto Forge(OrderEntity source);
}
// 3. Use it
var forger = new AppForger();
var dto = forger.Forge(entity);
Performance
ForgeMap is the fastest in benchmarks against AutoMapper and Mapperly (.NET 9, AMD EPYC 7763):
| Scenario | ForgeMap | Mapperly | AutoMapper |
|---|---|---|---|
| Simple (10 props) | 14.5 ns | 15.9 ns (1.1x) | 80.7 ns (5.6x) |
| Nested (2 levels) | 27.3 ns | 30.7 ns (1.1x) | 92.5 ns (3.4x) |
| Deep (4 levels) | 31.3 ns | 35.8 ns (1.1x) | 247.0 ns (7.9x) |
| Collection (1000) | 17.7 us | 20.1 us (1.1x) | 22.2 us (1.3x) |
See benchmarks/BENCHMARK_RESULTS.md for full details.
Migrating from AutoMapper
See the Migration Guide for step-by-step instructions and before/after code examples. ForgeMap also includes an AI-assisted migration tool (Claude Code skill) that can convert your existing AutoMapper CreateMap/Profile configurations to ForgeMap attributes automatically. See ForgeMap vs AutoMapper & Mapperly for a detailed feature comparison.
Documentation
See SPEC.md for the full specification. See CHANGELOG.md for version history.
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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 was computed. 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 was computed. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.