{"id":47608265,"url":"https://github.com/eggspot/eggmapper","last_synced_at":"2026-04-18T05:04:21.422Z","repository":{"id":345220694,"uuid":"1184931183","full_name":"eggspot/EggMapper","owner":"eggspot","description":"High-performance .NET object-to-object mapping library with zero runtime reflection and zero extra allocations. Faster than AutoMapper, Mapster, and AgileMapper on every benchmark.","archived":false,"fork":false,"pushed_at":"2026-04-18T03:25:43.000Z","size":754,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-18T04:24:03.192Z","etag":null,"topics":["aspnet","automapper","automapper-alternative","blazor","csharp","dependency-injection","dotnet","dotnet-library","dto","ef-core","expression-trees","mapper","nuget","object-mapping","performance"],"latest_commit_sha":null,"homepage":"https://eggspot.github.io/EggMapper","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eggspot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["eggspot"]}},"created_at":"2026-03-18T04:19:14.000Z","updated_at":"2026-04-18T03:20:57.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/eggspot/EggMapper","commit_stats":null,"previous_names":["eggspot/eggmapper"],"tags_count":46,"template":false,"template_full_name":null,"purl":"pkg:github/eggspot/EggMapper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eggspot%2FEggMapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eggspot%2FEggMapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eggspot%2FEggMapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eggspot%2FEggMapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eggspot","download_url":"https://codeload.github.com/eggspot/EggMapper/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eggspot%2FEggMapper/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31957158,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aspnet","automapper","automapper-alternative","blazor","csharp","dependency-injection","dotnet","dotnet-library","dto","ef-core","expression-trees","mapper","nuget","object-mapping","performance"],"created_at":"2026-04-01T19:41:11.930Z","updated_at":"2026-04-18T05:04:21.408Z","avatar_url":"https://github.com/eggspot.png","language":"C#","readme":"# 🥚 EggMapper\n\n\u003e **The fastest .NET runtime object-to-object mapper** — forked from AutoMapper's last open-source release, rebuilt for maximum performance. Drop-in replacement with the same API, 1.5–5× faster.\n\nSponsored by [eggspot.app](https://eggspot.app)\n\n[![CI](https://github.com/eggspot/EggMapper/actions/workflows/ci.yml/badge.svg)](https://github.com/eggspot/EggMapper/actions/workflows/ci.yml)\n[![Benchmarks](https://github.com/eggspot/EggMapper/actions/workflows/benchmarks.yml/badge.svg)](https://github.com/eggspot/EggMapper/actions/workflows/benchmarks.yml)\n[![NuGet](https://img.shields.io/nuget/v/EggMapper.svg)](https://www.nuget.org/packages/EggMapper)\n[![MIT License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)\n\n📖 **[Full documentation →](https://eggspot.github.io/EggMapper/)**\n\n## Overview\n\n**EggMapper** started as a fork of AutoMapper's last open-source release and was completely rewritten for performance. It keeps the **same familiar API** — `MapperConfiguration`, `CreateMap`, `ForMember`, `Profile`, `IMapper` — so you can switch from AutoMapper with minimal code changes. Under the hood, it compiles expression-tree delegates with inlined nested maps, typed collection loops, and static generic caching, achieving **zero reflection at map-time**, **zero extra allocations**, and near-manual mapping speed.\n\n### Migrating from AutoMapper?\n\nEggMapper is a **drop-in replacement**. In most cases, you only need to:\n\n1. Replace `using AutoMapper;` with `using EggMapper;`\n2. Replace `services.AddAutoMapper(...)` with `services.AddEggMapper(...)`\n\nThe same `CreateMap\u003c\u003e()`, `ForMember()`, `ReverseMap()`, `Profile`, and `IMapper` APIs work identically.\n\n### Why EggMapper?\n\n- 🚀 **Faster than Mapster** on flat, flattening, deep, and complex mappings\n- 🔥 **1.5–5× faster than AutoMapper** across all scenarios\n- 🎯 **Zero extra allocations** — matches hand-written code exactly\n- 🔁 **Drop-in AutoMapper replacement** — same fluent API, same patterns\n- 🧩 **Full feature set** — profiles, `ForMember`, `ReverseMap`, nested types, collections, DI, and more\n- 🪶 **Lightweight** — no runtime reflection, no unnecessary allocations\n- 📖 **MIT licensed** — free for commercial use, forever\n\n## Installation\n\n```bash\ndotnet add package EggMapper\n```\n\nDI support (`AddEggMapper`) is included in the main package — no separate package needed.\n\n## Quick Start\n\n```csharp\nusing EggMapper;\n\nvar config = new MapperConfiguration(cfg =\u003e {\n    cfg.CreateMap\u003cSource, Destination\u003e();\n});\n\nvar mapper = config.CreateMapper();\nvar dest = mapper.Map\u003cDestination\u003e(source);\n```\n\n## With Profiles\n\n```csharp\npublic class MyProfile : Profile\n{\n    public MyProfile()\n    {\n        CreateMap\u003cCustomer, CustomerDto\u003e()\n            .ForMember(d =\u003e d.FullName, opt =\u003e opt.MapFrom(s =\u003e $\"{s.FirstName} {s.LastName}\"))\n            .ForMember(d =\u003e d.AddressLine, opt =\u003e opt.MapFrom(s =\u003e s.Address.Street));\n    }\n}\n\nvar config = new MapperConfiguration(cfg =\u003e cfg.AddProfile\u003cMyProfile\u003e());\nvar mapper = config.CreateMapper();\n```\n\n## Dependency Injection\n\n```csharp\n// In Program.cs\nbuilder.Services.AddEggMapper(typeof(MyProfile).Assembly);\n\n// In your service\npublic class MyService(IMapper mapper) { ... }\n```\n\n## Performance\n\n\u003c!-- PERF_TIMESTAMP_START --\u003e\n\u003e ⏱ **Last updated:** 2026-03-27 14:14 UTC\n\u003c!-- PERF_TIMESTAMP_END --\u003e\n\nAll benchmarks run on BenchmarkDotNet with .NET 10. Ratio = time vs hand-written manual code (lower is better).\n\n\u003c!-- SUMMARY_TABLE_START --\u003e\n| Scenario | Manual | EggMapper | Mapster | AutoMapper | Mapperly* |\n|----------|--------|-----------|---------|------------|-----------|\n| **Flat (10 props)** | 16.18 ns | **26.37 ns (1.6×)** | 29.60 ns (1.8×) | 83.46 ns (5.2×) | 16.35 ns (1.0×) |\n| **Flattening** | 20.13 ns | **30.75 ns (1.5×)** | 49.36 ns (2.5×) | 89.57 ns (4.5×) | 25.17 ns (1.2×) |\n| **Deep (2 nested)** | 57.31 ns | **68.33 ns (1.2×)** | 71.55 ns (1.2×) | 130.89 ns (2.3×) | 52.95 ns (0.9×) |\n| **Complex (nest+coll)** | 75.37 ns | **96.50 ns (1.3×)** | 94.28 ns (1.2×) | 157.61 ns (2.1×) | 75.47 ns (1.0×) |\n| **Collection (100)** | 1.916 μs | **1.864 μs (1.0×)** | 1.850 μs (1.0×) | 2.510 μs (1.3×) | 1.995 μs (1.0×) |\n| **Deep Coll (100)** | 6.277 μs | **6.111 μs (1.0×)** | 6.482 μs (1.0×) | 6.917 μs (1.1×) | 5.772 μs (0.9×) |\n| **Large Coll (1000)** | 19.30 μs | **18.85 μs (1.0×)** | 18.52 μs (1.0×) | 22.90 μs (1.2×) | 22.06 μs (1.1×) |\n\u003c!-- SUMMARY_TABLE_END --\u003e\n\n**\\*** *Mapperly is a compile-time source generator — it produces code equivalent to hand-written mapping. EggMapper is the fastest **runtime** mapper.*\n\n**Allocations:** EggMapper matches manual allocation exactly in every scenario (zero extra bytes).\n\nRun the benchmarks yourself:\n\n```bash\ncd src/EggMapper.Benchmarks\ndotnet run --configuration Release -f net10.0 -- --filter * --exporters json markdown\n```\n\n\u003c!-- BENCHMARK_RESULTS_START --\u003e\n\n\u003e **Competitors tested:** EggMapper, AutoMapper, Mapster, Mapperly (source-gen), AgileMapper\n\n\u003e **Column guide:** `Mean` = avg time · `Error` = ½ CI · `StdDev` = std dev · `Min`/`Median`/`Max` = range · `Ratio` = vs Manual baseline · `Rank` = 1 is fastest · `Allocated` = heap / op\n\n#### 🔵 Flat Mapping (10 properties)\n\n| Method               | Mean      | Error    | StdDev   | Min       | Median    | Max       | Ratio | RatioSD | Rank | Gen0   | Allocated | Alloc Ratio |\n|--------------------- |----------:|---------:|---------:|----------:|----------:|----------:|------:|--------:|-----:|-------:|----------:|------------:|\n| Manual               |  16.18 ns | 0.167 ns | 0.157 ns |  15.94 ns |  16.15 ns |  16.48 ns |  1.00 |    0.01 |    1 | 0.0048 |      80 B |        1.00 |\n| EggMapper            |  26.37 ns | 0.190 ns | 0.169 ns |  26.05 ns |  26.38 ns |  26.72 ns |  1.63 |    0.02 |    2 | 0.0048 |      80 B |        1.00 |\n| AutoMapper           |  83.46 ns | 0.256 ns | 0.239 ns |  83.01 ns |  83.47 ns |  83.90 ns |  5.16 |    0.05 |    4 | 0.0048 |      80 B |        1.00 |\n| Mapster              |  29.60 ns | 0.187 ns | 0.166 ns |  29.28 ns |  29.56 ns |  29.84 ns |  1.83 |    0.02 |    3 | 0.0048 |      80 B |        1.00 |\n| MapperlyMap          |  16.35 ns | 0.196 ns | 0.184 ns |  16.10 ns |  16.29 ns |  16.62 ns |  1.01 |    0.01 |    1 | 0.0048 |      80 B |        1.00 |\n| AgileMapper          | 514.51 ns | 1.664 ns | 1.557 ns | 511.60 ns | 514.79 ns | 516.59 ns | 31.80 |    0.31 |    5 | 0.0200 |     344 B |        4.30 |\n| EggMapperGenerator   |  15.94 ns | 0.178 ns | 0.167 ns |  15.53 ns |  15.98 ns |  16.15 ns |  0.99 |    0.01 |    1 | 0.0048 |      80 B |        1.00 |\n| EggMapperClassMapper |  16.74 ns | 0.108 ns | 0.090 ns |  16.63 ns |  16.74 ns |  16.91 ns |  1.03 |    0.01 |    1 | 0.0048 |      80 B |        1.00 |\n\n#### 🟡 Flattening\n\n| Method      | Mean      | Error    | StdDev   | Min       | Median    | Max       | Ratio | RatioSD | Rank | Gen0   | Allocated | Alloc Ratio |\n|------------ |----------:|---------:|---------:|----------:|----------:|----------:|------:|--------:|-----:|-------:|----------:|------------:|\n| Manual      |  20.13 ns | 0.174 ns | 0.154 ns |  19.87 ns |  20.13 ns |  20.42 ns |  1.00 |    0.01 |    1 | 0.0048 |      80 B |        1.00 |\n| EggMap      |  30.75 ns | 0.244 ns | 0.204 ns |  30.13 ns |  30.78 ns |  30.95 ns |  1.53 |    0.01 |    3 | 0.0048 |      80 B |        1.00 |\n| AutoMapper  |  89.57 ns | 0.206 ns | 0.172 ns |  89.34 ns |  89.60 ns |  89.86 ns |  4.45 |    0.03 |    5 | 0.0048 |      80 B |        1.00 |\n| Mapster     |  49.36 ns | 0.231 ns | 0.205 ns |  48.99 ns |  49.34 ns |  49.67 ns |  2.45 |    0.02 |    4 | 0.0048 |      80 B |        1.00 |\n| MapperlyMap |  25.17 ns | 0.132 ns | 0.123 ns |  24.97 ns |  25.13 ns |  25.38 ns |  1.25 |    0.01 |    2 | 0.0062 |     104 B |        1.30 |\n| AgileMapper | 529.57 ns | 1.187 ns | 1.110 ns | 527.31 ns | 529.50 ns | 531.21 ns | 26.31 |    0.20 |    6 | 0.0200 |     344 B |        4.30 |\n\n#### 🟣 Deep Mapping (2 nested objects)\n\n| Method      | Mean      | Error    | StdDev   | Min       | Median    | Max       | Ratio | RatioSD | Rank | Gen0   | Allocated | Alloc Ratio |\n|------------ |----------:|---------:|---------:|----------:|----------:|----------:|------:|--------:|-----:|-------:|----------:|------------:|\n| Manual      |  57.31 ns | 0.494 ns | 0.412 ns |  56.76 ns |  57.27 ns |  58.15 ns |  1.00 |    0.01 |    2 | 0.0162 |     272 B |        1.00 |\n| EggMapper   |  68.33 ns | 0.512 ns | 0.454 ns |  67.57 ns |  68.38 ns |  69.04 ns |  1.19 |    0.01 |    3 | 0.0162 |     272 B |        1.00 |\n| AutoMapper  | 130.89 ns | 0.631 ns | 0.591 ns | 129.93 ns | 130.87 ns | 131.96 ns |  2.28 |    0.02 |    5 | 0.0162 |     272 B |        1.00 |\n| Mapster     |  71.55 ns | 0.646 ns | 0.604 ns |  70.27 ns |  71.60 ns |  72.60 ns |  1.25 |    0.01 |    4 | 0.0162 |     272 B |        1.00 |\n| MapperlyMap |  52.95 ns | 0.315 ns | 0.279 ns |  52.35 ns |  52.97 ns |  53.30 ns |  0.92 |    0.01 |    1 | 0.0162 |     272 B |        1.00 |\n| AgileMapper | 514.21 ns | 1.865 ns | 1.744 ns | 512.00 ns | 513.78 ns | 517.66 ns |  8.97 |    0.07 |    6 | 0.0248 |     424 B |        1.56 |\n\n#### 🟢 Complex Mapping (nested + collection)\n\n| Method      | Mean      | Error    | StdDev   | Min       | Median    | Max       | Ratio | RatioSD | Rank | Gen0   | Allocated | Alloc Ratio |\n|------------ |----------:|---------:|---------:|----------:|----------:|----------:|------:|--------:|-----:|-------:|----------:|------------:|\n| Manual      |  75.37 ns | 0.466 ns | 0.436 ns |  74.75 ns |  75.41 ns |  76.16 ns |  1.00 |    0.01 |    1 | 0.0191 |     320 B |        1.00 |\n| EggMapper   |  96.50 ns | 0.543 ns | 0.481 ns |  95.84 ns |  96.42 ns |  97.25 ns |  1.28 |    0.01 |    2 | 0.0191 |     320 B |        1.00 |\n| AutoMapper  | 157.61 ns | 0.971 ns | 0.908 ns | 156.13 ns | 157.62 ns | 159.36 ns |  2.09 |    0.02 |    3 | 0.0196 |     328 B |        1.02 |\n| Mapster     |  94.28 ns | 0.975 ns | 0.912 ns |  92.22 ns |  94.66 ns |  95.59 ns |  1.25 |    0.01 |    2 | 0.0191 |     320 B |        1.00 |\n| MapperlyMap |  75.47 ns | 0.740 ns | 0.692 ns |  74.61 ns |  75.26 ns |  76.41 ns |  1.00 |    0.01 |    1 | 0.0191 |     320 B |        1.00 |\n| AgileMapper | 582.33 ns | 1.241 ns | 1.100 ns | 580.78 ns | 582.43 ns | 584.49 ns |  7.73 |    0.05 |    4 | 0.0315 |     528 B |        1.65 |\n\n#### 🟠 Collection (100 items)\n\n| Method      | Mean     | Error     | StdDev    | Min      | Median   | Max      | Ratio | RatioSD | Rank | Gen0   | Gen1   | Allocated | Alloc Ratio |\n|------------ |---------:|----------:|----------:|---------:|---------:|---------:|------:|--------:|-----:|-------:|-------:|----------:|------------:|\n| Manual      | 1.916 μs | 0.0089 μs | 0.0074 μs | 1.901 μs | 1.916 μs | 1.927 μs |  1.00 |    0.01 |    1 | 0.5283 | 0.0172 |   8.65 KB |        1.00 |\n| EggMapper   | 1.864 μs | 0.0287 μs | 0.0269 μs | 1.812 μs | 1.868 μs | 1.905 μs |  0.97 |    0.01 |    1 | 0.5283 | 0.0172 |   8.65 KB |        1.00 |\n| AutoMapper  | 2.510 μs | 0.0425 μs | 0.0398 μs | 2.459 μs | 2.521 μs | 2.584 μs |  1.31 |    0.02 |    3 | 0.6065 | 0.0191 |   9.95 KB |        1.15 |\n| Mapster     | 1.850 μs | 0.0358 μs | 0.0335 μs | 1.799 μs | 1.841 μs | 1.914 μs |  0.97 |    0.02 |    1 | 0.5283 | 0.0172 |   8.65 KB |        1.00 |\n| MapperlyMap | 1.995 μs | 0.0136 μs | 0.0127 μs | 1.967 μs | 1.994 μs | 2.019 μs |  1.04 |    0.01 |    2 | 0.5264 | 0.0153 |   8.65 KB |        1.00 |\n| AgileMapper | 2.685 μs | 0.0188 μs | 0.0157 μs | 2.661 μs | 2.687 μs | 2.715 μs |  1.40 |    0.01 |    4 | 0.5417 | 0.0153 |   8.91 KB |        1.03 |\n\n#### 🔴 Deep Collection (100 items, nested)\n\n| Method      | Mean     | Error     | StdDev    | Min      | Median   | Max      | Ratio | Rank | Gen0   | Gen1   | Allocated | Alloc Ratio |\n|------------ |---------:|----------:|----------:|---------:|---------:|---------:|------:|-----:|-------:|-------:|----------:|------------:|\n| Manual      | 6.277 μs | 0.0681 μs | 0.0637 μs | 6.168 μs | 6.275 μs | 6.380 μs |  1.00 |    3 | 1.6708 | 0.0916 |   27.4 KB |        1.00 |\n| EggMapper   | 6.111 μs | 0.0636 μs | 0.0595 μs | 5.996 μs | 6.122 μs | 6.191 μs |  0.97 |    3 | 1.6708 | 0.0916 |   27.4 KB |        1.00 |\n| AutoMapper  | 6.917 μs | 0.0447 μs | 0.0396 μs | 6.822 μs | 6.912 μs | 6.992 μs |  1.10 |    4 | 1.7548 | 0.1068 |   28.7 KB |        1.05 |\n| Mapster     | 6.482 μs | 0.0742 μs | 0.0694 μs | 6.392 μs | 6.482 μs | 6.629 μs |  1.03 |    3 | 1.6708 | 0.0916 |   27.4 KB |        1.00 |\n| MapperlyMap | 5.772 μs | 0.0491 μs | 0.0459 μs | 5.675 μs | 5.783 μs | 5.854 μs |  0.92 |    2 | 1.6785 | 0.0992 |  27.42 KB |        1.00 |\n| AgileMapper | 5.505 μs | 0.0411 μs | 0.0365 μs | 5.468 μs | 5.491 μs | 5.597 μs |  0.88 |    1 | 1.0223 | 0.0610 |  16.72 KB |        0.61 |\n\n#### ⚫ Large Collection (1,000 items)\n\n| Method      | Mean     | Error    | StdDev   | Min      | Median   | Max      | Ratio | RatioSD | Rank | Gen0   | Gen1   | Allocated | Alloc Ratio |\n|------------ |---------:|---------:|---------:|---------:|---------:|---------:|------:|--------:|-----:|-------:|-------:|----------:|------------:|\n| Manual      | 19.30 μs | 0.208 μs | 0.184 μs | 19.06 μs | 19.29 μs | 19.69 μs |  1.00 |    0.01 |    1 | 5.2490 | 1.3123 |  85.99 KB |        1.00 |\n| EggMapper   | 18.85 μs | 0.162 μs | 0.135 μs | 18.55 μs | 18.88 μs | 19.08 μs |  0.98 |    0.01 |    1 | 5.2490 | 1.3123 |  85.99 KB |        1.00 |\n| AutoMapper  | 22.90 μs | 0.225 μs | 0.211 μs | 22.51 μs | 22.89 μs | 23.22 μs |  1.19 |    0.02 |    3 | 5.7678 | 1.4343 |  94.34 KB |        1.10 |\n| Mapster     | 18.52 μs | 0.155 μs | 0.145 μs | 18.28 μs | 18.49 μs | 18.71 μs |  0.96 |    0.01 |    1 | 5.2490 | 1.3123 |  85.99 KB |        1.00 |\n| MapperlyMap | 22.06 μs | 0.172 μs | 0.161 μs | 21.80 μs | 22.02 μs | 22.38 μs |  1.14 |    0.01 |    2 | 5.2490 | 1.2817 |  86.02 KB |        1.00 |\n| AgileMapper | 21.57 μs | 0.266 μs | 0.236 μs | 21.17 μs | 21.58 μs | 21.97 μs |  1.12 |    0.02 |    2 | 5.2795 | 1.3123 |  86.25 KB |        1.00 |\n\n#### ⚪ Startup / Config\n\n| Method            | Mean         | Error     | StdDev    | Min          | Median       | Max          | Ratio | Rank | Gen0   | Gen1   | Allocated | Alloc Ratio |\n|------------------ |-------------:|----------:|----------:|-------------:|-------------:|-------------:|------:|-----:|-------:|-------:|----------:|------------:|\n| EggMapperStartup  | 1,199.826 μs | 6.7724 μs | 6.3350 μs | 1,190.649 μs | 1,200.022 μs | 1,210.590 μs | 1.000 |    3 | 5.8594 |      - |  95.69 KB |        1.00 |\n| AutoMapperStartup |   282.899 μs | 1.2716 μs | 1.1272 μs |   280.515 μs |   282.702 μs |   285.338 μs | 0.236 |    2 | 5.8594 |      - | 104.04 KB |        1.09 |\n| MapsterStartup    |     2.639 μs | 0.0329 μs | 0.0292 μs |     2.592 μs |     2.641 μs |     2.695 μs | 0.002 |    1 | 0.7019 | 0.0267 |  11.51 KB |        0.12 |\n\n#### ⚪ Cold Start (Config + First Map per Type Pair)\n\n| Method     | Mean     | Error     | StdDev    | Min      | Median   | Max      | Ratio | RatioSD | Rank | Gen0    | Gen1    | Allocated | Alloc Ratio |\n|----------- |---------:|----------:|----------:|---------:|---------:|---------:|------:|--------:|-----:|--------:|--------:|----------:|------------:|\n| EggMapper  | 1.165 ms | 0.0100 ms | 0.0094 ms | 1.154 ms | 1.165 ms | 1.184 ms |  1.00 |    0.01 |    1 |  5.8594 |  3.9063 |  95.98 KB |        1.00 |\n| AutoMapper | 3.297 ms | 0.0157 ms | 0.0139 ms | 3.278 ms | 3.295 ms | 3.323 ms |  2.83 |    0.02 |    3 | 15.6250 |  7.8125 | 310.17 KB |        3.23 |\n| Mapster    | 2.552 ms | 0.0129 ms | 0.0114 ms | 2.529 ms | 2.555 ms | 2.569 ms |  2.19 |    0.02 |    2 | 39.0625 | 15.6250 | 764.06 KB |        7.96 |\n\n---\n\n*Benchmarks run automatically on every push to `main` with .NET 10. [See workflow](https://github.com/eggspot/EggMapper/actions/workflows/benchmarks.yml)*\n\n\u003c!-- BENCHMARK_RESULTS_END --\u003e\n\n## Features\n\n\u003c!-- FEATURES_START --\u003e\n- ✅ Compiled expression tree delegates (zero runtime reflection)\n- ✅ `ForMember` / `MapFrom` custom mappings\n- ✅ `Ignore()` members\n- ✅ `ReverseMap()` bidirectional mapping\n- ✅ Nested object mapping (inlined into parent expression tree)\n- ✅ Collection mapping (`List\u003cT\u003e`, arrays, `HashSet\u003cT\u003e`, etc.)\n- ✅ Flattening (`src.Address.Street` → `dest.AddressStreet`)\n- ✅ Constructor mapping (auto-detects best-matching constructor for records)\n- ✅ Profile-based configuration\n- ✅ Assembly scanning\n- ✅ Before/After map hooks\n- ✅ Conditional mapping\n- ✅ Null substitution\n- ✅ `MaxDepth` for self-referencing types\n- ✅ Inheritance mapping\n- ✅ Enum mapping (int ↔ enum and string ↔ enum auto-conversion)\n- ✅ `ForPath` for nested destination properties\n- ✅ .NET Dependency Injection integration (transient `IMapper`, scoped service support)\n- ✅ EF Core proxy / derived type resolution (base-type + interface walk)\n- ✅ Constructor-based type conversion in `MapFrom(s =\u003e s)` patterns\n- ✅ Configuration validation\n- ✅ `CreateMap(Type, Type)` runtime type mapping\n- ✅ `ITypeConverter\u003cS,D\u003e` / `ConvertUsing` custom converters\n- ✅ `ShouldMapProperty` global property filter\n- ✅ Patch / partial mapping via `mapper.Patch\u003cS,D\u003e(src, dest)`\n- ✅ Inline validation rules via `.Validate()` (collects all failures before throwing)\n- ✅ IQueryable projection via `ProjectTo\u003cS,D\u003e(config)` for EF Core / LINQ providers\n\u003c!-- FEATURES_END --\u003e\n\n## Mapping Tiers\n\nEggMapper supports three complementary mapping approaches. Choose based on your use case:\n\n| | **Runtime** (`EggMapper`) | **Attribute Mapper** (`EggMapper.Generator`) | **Class Mapper** (`EggMapper.ClassMapper`) |\n|---|---|---|---|\n| **API** | `MapperConfiguration` + `CreateMap` | `[MapTo(typeof(Dest))]` attribute | `[EggMapper]` partial class |\n| **Mapping errors detected** | Runtime | ✅ Build time | ✅ Build time |\n| **Reflection at map time** | None (expression trees) | ✅ None (generated code) | ✅ None (generated code) |\n| **Startup cost** | Compilation (once) | ✅ None | ✅ None |\n| **Custom logic** | Full (`ForMember`, hooks, etc.) | `AfterMap` hook | Full custom methods |\n| **Reverse mapping** | `ReverseMap()` | Separate `[MapTo]` annotation | Declare both `partial` methods |\n| **DI-friendly instance** | `IMapper` | N/A (extension methods) | ✅ `Instance` + constructors |\n| **Migration from AutoMapper** | ✅ Drop-in | Via EGG1003 suggestion | New API |\n| **Best for** | Complex/conditional mapping | Simple 1:1 copies | Custom logic + compile safety |\n\nSee [Migration Guide](https://eggspot.github.io/EggMapper/Migration-Guide.html) to move from runtime to compile-time APIs.\n\n---\n\n## Documentation\n\n| Page | Description |\n|------|-------------|\n| [Getting Started](https://eggspot.github.io/EggMapper/Getting-Started.html) | Installation and your first runtime mapping |\n| [Attribute Mapper](https://eggspot.github.io/EggMapper/Attribute-Mapper.html) | Compile-time extension methods with `[MapTo]` |\n| [Class Mapper](https://eggspot.github.io/EggMapper/Class-Mapper.html) | Compile-time partial mapper classes with `[EggMapper]` |\n| [Migration Guide](https://eggspot.github.io/EggMapper/Migration-Guide.html) | Moving from AutoMapper or runtime to compile-time APIs |\n| [Configuration](https://eggspot.github.io/EggMapper/Configuration.html) | `MapperConfiguration` options |\n| [Profiles](https://eggspot.github.io/EggMapper/Profiles.html) | Organising maps with `Profile` |\n| [Dependency Injection](https://eggspot.github.io/EggMapper/Dependency-Injection.html) | ASP.NET Core / DI integration |\n| [Advanced Features](https://eggspot.github.io/EggMapper/Advanced-Features.html) | `ForMember`, conditions, hooks, etc. |\n| [Performance](https://eggspot.github.io/EggMapper/Performance.html) | Benchmark methodology \u0026 tips |\n| [API Reference](https://eggspot.github.io/EggMapper/API-Reference.html) | Full public API surface |\n| [Diagnostic Reference](https://eggspot.github.io/EggMapper/diagnostics/EGG1002.html) | All EGG diagnostic codes explained |\n\n## Sponsor\n\nEggMapper is built and maintained by [Eggspot](https://eggspot.app). If this library saves you time or money, consider supporting its development:\n\n\u003ca href=\"https://github.com/sponsors/eggspot\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Sponsor_EggMapper-❤️-ea4aaa?style=for-the-badge\u0026logo=github\" alt=\"Sponsor EggMapper\" /\u003e\n\u003c/a\u003e\n\nSponsorships help fund:\n- Continuous performance optimization and benchmarking\n- New feature development\n- Bug fixes and maintenance\n- Documentation and community support\n\n## Contributing\n\nWe welcome contributions from the community! Here's how you can help:\n\n- **Report bugs** — [Open an issue](https://github.com/eggspot/EggMapper/issues/new?template=bug_report.md)\n- **Request features** — [Start a discussion](https://github.com/eggspot/EggMapper/discussions/new?category=ideas)\n- **Submit code** — Fork, branch, and [open a pull request](https://github.com/eggspot/EggMapper/pulls)\n- **Improve docs** — Edit files in the `docs/` folder (published to [eggspot.github.io/EggMapper](https://eggspot.github.io/EggMapper/))\n- **Share benchmarks** — Run on your hardware and share results\n\n### Development Setup\n\n```bash\ngit clone https://github.com/eggspot/EggMapper.git\ncd EggMapper\ndotnet build --configuration Release\ndotnet test --configuration Release\n```\n\n### Contribution Guidelines\n\n1. **Fork** the repository and create a branch from `main`\n2. **Write tests** for any new functionality\n3. **Run all tests** — `dotnet test --configuration Release` must pass on all TFMs\n4. **Run benchmarks** if changing core mapping code — `cd src/EggMapper.Benchmarks \u0026\u0026 dotnet run -c Release -f net10.0 -- --filter *`\n5. **Open a PR** with a clear description of the change\n\nAll contributors are recognized in the GitHub Release notes automatically.\n\n---\n\n*Powered by [Eggspot](https://eggspot.app)*\n","funding_links":["https://github.com/sponsors/eggspot"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feggspot%2Feggmapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feggspot%2Feggmapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feggspot%2Feggmapper/lists"}