{"id":47608265,"url":"https://github.com/eggspot/eggmapper","last_synced_at":"2026-05-02T10:03:24.030Z","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-05-01T16:17:55.000Z","size":804,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-01T16:24:38.037Z","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-05-01T15:59:08.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":32530178,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-02T01:12:54.858Z","status":"online","status_checked_at":"2026-05-02T02:00:05.923Z","response_time":132,"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-05-02T10:03:24.023Z","avatar_url":"https://github.com/eggspot.png","language":"C#","funding_links":["https://github.com/sponsors/eggspot"],"categories":[],"sub_categories":[],"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-05-01 17:19 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.28 ns | **26.69 ns (1.6×)** | 28.77 ns (1.8×) | 81.78 ns (5.0×) | 16.24 ns (1.0×) |\n| **Flattening** | 20.32 ns | **31.40 ns (1.6×)** | 34.92 ns (1.7×) | 81.19 ns (4.0×) | 25.77 ns (1.3×) |\n| **Deep (2 nested)** | 57.85 ns | **73.59 ns (1.3×)** | 72.58 ns (1.2×) | 109.06 ns (1.9×) | 56.32 ns (1.0×) |\n| **Complex (nest+coll)** | 82.74 ns | **107.48 ns (1.3×)** | 103.45 ns (1.2×) | 146.89 ns (1.8×) | 80.72 ns (1.0×) |\n| **Collection (100)** | 2.088 μs | **2.171 μs (1.0×)** | 2.032 μs (1.0×) | 2.650 μs (1.3×) | 2.242 μs (1.1×) |\n| **Deep Coll (100)** | 6.001 μs | **6.398 μs (1.1×)** | 6.508 μs (1.1×) | 7.153 μs (1.2×) | 5.946 μs (1.0×) |\n| **Large Coll (1000)** | 21.92 μs | **21.75 μs (1.0×)** | 21.00 μs (1.0×) | 24.75 μs (1.1×) | 21.99 μs (1.0×) |\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.28 ns | 0.216 ns | 0.191 ns |  15.94 ns |  16.27 ns |  16.63 ns |  1.00 |    0.02 |    1 | 0.0048 |      80 B |        1.00 |\n| EggMapper            |  26.69 ns | 0.168 ns | 0.141 ns |  26.38 ns |  26.69 ns |  26.91 ns |  1.64 |    0.02 |    3 | 0.0048 |      80 B |        1.00 |\n| AutoMapper           |  81.78 ns | 0.141 ns | 0.125 ns |  81.48 ns |  81.79 ns |  81.98 ns |  5.02 |    0.06 |    5 | 0.0048 |      80 B |        1.00 |\n| Mapster              |  28.77 ns | 0.317 ns | 0.296 ns |  28.38 ns |  28.71 ns |  29.28 ns |  1.77 |    0.03 |    4 | 0.0048 |      80 B |        1.00 |\n| MapperlyMap          |  16.24 ns | 0.160 ns | 0.142 ns |  15.93 ns |  16.29 ns |  16.40 ns |  1.00 |    0.01 |    1 | 0.0048 |      80 B |        1.00 |\n| AgileMapper          | 333.59 ns | 1.334 ns | 1.248 ns | 331.09 ns | 333.45 ns | 335.67 ns | 20.49 |    0.24 |    6 | 0.0205 |     344 B |        4.30 |\n| EggMapperGenerator   |  16.42 ns | 0.205 ns | 0.192 ns |  16.00 ns |  16.46 ns |  16.70 ns |  1.01 |    0.02 |    1 | 0.0048 |      80 B |        1.00 |\n| EggMapperClassMapper |  17.27 ns | 0.215 ns | 0.201 ns |  16.89 ns |  17.29 ns |  17.60 ns |  1.06 |    0.02 |    2 | 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.32 ns | 0.155 ns | 0.137 ns |  20.15 ns |  20.27 ns |  20.59 ns |  1.00 |    0.01 |    1 | 0.0048 |      80 B |        1.00 |\n| EggMap      |  31.40 ns | 0.366 ns | 0.342 ns |  31.00 ns |  31.26 ns |  32.16 ns |  1.55 |    0.02 |    3 | 0.0048 |      80 B |        1.00 |\n| AutoMapper  |  81.19 ns | 0.231 ns | 0.205 ns |  80.86 ns |  81.19 ns |  81.55 ns |  4.00 |    0.03 |    5 | 0.0048 |      80 B |        1.00 |\n| Mapster     |  34.92 ns | 0.101 ns | 0.084 ns |  34.81 ns |  34.88 ns |  35.10 ns |  1.72 |    0.01 |    4 | 0.0048 |      80 B |        1.00 |\n| MapperlyMap |  25.77 ns | 0.361 ns | 0.338 ns |  25.43 ns |  25.67 ns |  26.19 ns |  1.27 |    0.02 |    2 | 0.0062 |     104 B |        1.30 |\n| AgileMapper | 333.89 ns | 1.756 ns | 1.557 ns | 330.43 ns | 333.76 ns | 336.87 ns | 16.43 |    0.13 |    6 | 0.0205 |     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.85 ns | 0.127 ns | 0.113 ns |  57.73 ns |  57.83 ns |  58.06 ns |  1.00 |    0.00 |    1 | 0.0162 |     272 B |        1.00 |\n| EggMapper   |  73.59 ns | 0.491 ns | 0.459 ns |  72.83 ns |  73.65 ns |  74.32 ns |  1.27 |    0.01 |    2 | 0.0162 |     272 B |        1.00 |\n| AutoMapper  | 109.06 ns | 0.164 ns | 0.145 ns | 108.84 ns | 109.04 ns | 109.32 ns |  1.89 |    0.00 |    3 | 0.0162 |     272 B |        1.00 |\n| Mapster     |  72.58 ns | 0.189 ns | 0.177 ns |  72.41 ns |  72.54 ns |  72.90 ns |  1.25 |    0.00 |    2 | 0.0162 |     272 B |        1.00 |\n| MapperlyMap |  56.32 ns | 0.674 ns | 0.630 ns |  55.47 ns |  56.28 ns |  57.56 ns |  0.97 |    0.01 |    1 | 0.0162 |     272 B |        1.00 |\n| AgileMapper | 412.46 ns | 0.983 ns | 0.871 ns | 410.56 ns | 412.52 ns | 414.07 ns |  7.13 |    0.02 |    4 | 0.0253 |     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      |  82.74 ns | 0.525 ns | 0.491 ns |  81.76 ns |  82.98 ns |  83.23 ns |  1.00 |    0.01 |    1 | 0.0191 |     320 B |        1.00 |\n| EggMapper   | 107.48 ns | 0.952 ns | 0.890 ns | 105.74 ns | 107.61 ns | 108.67 ns |  1.30 |    0.01 |    3 | 0.0191 |     320 B |        1.00 |\n| AutoMapper  | 146.89 ns | 1.469 ns | 1.375 ns | 144.72 ns | 146.71 ns | 149.89 ns |  1.78 |    0.02 |    4 | 0.0196 |     328 B |        1.02 |\n| Mapster     | 103.45 ns | 0.702 ns | 0.622 ns | 102.19 ns | 103.41 ns | 104.51 ns |  1.25 |    0.01 |    2 | 0.0191 |     320 B |        1.00 |\n| MapperlyMap |  80.72 ns | 0.719 ns | 0.673 ns |  79.42 ns |  80.91 ns |  81.64 ns |  0.98 |    0.01 |    1 | 0.0191 |     320 B |        1.00 |\n| AgileMapper | 397.18 ns | 1.295 ns | 1.082 ns | 395.51 ns | 397.19 ns | 399.32 ns |  4.80 |    0.03 |    5 | 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      | 2.088 μs | 0.0417 μs | 0.1113 μs | 1.932 μs | 2.072 μs | 2.372 μs |  1.00 |    0.07 |    1 | 0.5264 | 0.0153 |   8.65 KB |        1.00 |\n| EggMapper   | 2.171 μs | 0.0375 μs | 0.0351 μs | 2.121 μs | 2.167 μs | 2.255 μs |  1.04 |    0.06 |    1 | 0.5264 | 0.0153 |   8.65 KB |        1.00 |\n| AutoMapper  | 2.650 μs | 0.0338 μs | 0.0316 μs | 2.598 μs | 2.648 μs | 2.703 μs |  1.27 |    0.07 |    2 | 0.6065 | 0.0191 |   9.95 KB |        1.15 |\n| Mapster     | 2.032 μs | 0.0393 μs | 0.0436 μs | 1.959 μs | 2.027 μs | 2.115 μs |  0.98 |    0.05 |    1 | 0.5264 | 0.0153 |   8.65 KB |        1.00 |\n| MapperlyMap | 2.242 μs | 0.0390 μs | 0.0365 μs | 2.146 μs | 2.244 μs | 2.288 μs |  1.08 |    0.06 |    1 | 0.5264 | 0.0153 |   8.65 KB |        1.00 |\n| AgileMapper | 2.776 μs | 0.0552 μs | 0.1164 μs | 2.601 μs | 2.781 μs | 3.043 μs |  1.33 |    0.09 |    2 | 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.001 μs | 0.0324 μs | 0.0270 μs | 5.938 μs | 6.019 μs | 6.024 μs |  1.00 |    2 | 1.6708 | 0.0916 |   27.4 KB |        1.00 |\n| EggMapper   | 6.398 μs | 0.0378 μs | 0.0335 μs | 6.302 μs | 6.408 μs | 6.425 μs |  1.07 |    3 | 1.6708 | 0.0916 |   27.4 KB |        1.00 |\n| AutoMapper  | 7.153 μs | 0.0372 μs | 0.0311 μs | 7.077 μs | 7.157 μs | 7.196 μs |  1.19 |    4 | 1.7548 | 0.1068 |   28.7 KB |        1.05 |\n| Mapster     | 6.508 μs | 0.0446 μs | 0.0396 μs | 6.416 μs | 6.514 μs | 6.572 μs |  1.08 |    3 | 1.6708 | 0.0916 |   27.4 KB |        1.00 |\n| MapperlyMap | 5.946 μs | 0.0106 μs | 0.0094 μs | 5.935 μs | 5.943 μs | 5.968 μs |  0.99 |    2 | 1.6785 | 0.0992 |  27.42 KB |        1.00 |\n| AgileMapper | 5.651 μs | 0.0328 μs | 0.0274 μs | 5.599 μs | 5.653 μs | 5.706 μs |  0.94 |    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      | 21.92 μs | 0.345 μs | 0.288 μs | 21.37 μs | 21.96 μs | 22.47 μs |  1.00 |    0.02 |    1 | 5.2490 | 1.3123 |  85.99 KB |        1.00 |\n| EggMapper   | 21.75 μs | 0.425 μs | 0.745 μs | 19.82 μs | 21.83 μs | 23.33 μs |  0.99 |    0.04 |    1 | 5.2490 | 1.3123 |  85.99 KB |        1.00 |\n| AutoMapper  | 24.75 μs | 0.479 μs | 0.655 μs | 23.86 μs | 24.59 μs | 26.29 μs |  1.13 |    0.03 |    3 | 5.7678 | 1.4343 |  94.34 KB |        1.10 |\n| Mapster     | 21.00 μs | 0.402 μs | 0.395 μs | 20.08 μs | 20.93 μs | 21.68 μs |  0.96 |    0.02 |    1 | 5.2490 | 1.3123 |  85.99 KB |        1.00 |\n| MapperlyMap | 21.99 μs | 0.436 μs | 0.728 μs | 20.77 μs | 22.04 μs | 23.63 μs |  1.00 |    0.04 |    1 | 5.2490 | 1.2817 |  86.02 KB |        1.00 |\n| AgileMapper | 23.53 μs | 0.315 μs | 0.337 μs | 22.97 μs | 23.52 μs | 24.33 μs |  1.07 |    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,167.515 μs | 8.6462 μs | 7.2200 μs | 1,154.638 μs | 1,166.140 μs | 1,178.981 μs | 1.000 |    3 | 3.9063 | 1.9531 |   95.2 KB |        1.00 |\n| AutoMapperStartup |   246.947 μs | 1.2288 μs | 1.0893 μs |   244.479 μs |   247.263 μs |   248.474 μs | 0.212 |    2 | 5.8594 |      - | 103.82 KB |        1.09 |\n| MapsterStartup    |     2.719 μs | 0.0541 μs | 0.0842 μs |     2.598 μs |     2.700 μs |     2.900 μ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.174 ms | 0.0176 ms | 0.0156 ms | 1.150 ms | 1.181 ms | 1.198 ms |  1.00 |    0.02 |    1 |  5.8594 |  3.9063 |  95.84 KB |        1.00 |\n| AutoMapper | 3.533 ms | 0.0562 ms | 0.0525 ms | 3.404 ms | 3.554 ms | 3.583 ms |  3.01 |    0.06 |    3 | 15.6250 |  7.8125 | 309.72 KB |        3.23 |\n| Mapster    | 2.630 ms | 0.0084 ms | 0.0070 ms | 2.619 ms | 2.630 ms | 2.644 ms |  2.24 |    0.03 |    2 | 46.8750 | 15.6250 | 766.46 KB |        8.00 |\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- ✅ Null source collection → empty destination collection (default `AllowNullCollections = false` semantics)\n- ✅ Unmatched destination collection properties auto-initialized to empty (top-level + nested inline maps)\n- ✅ `Ignore()` on getter-only and non-public-setter properties; non-`Ignore()` ops throw at config time\n- ✅ Custom `IEnumerable` wrappers (e.g. `SelectList`) auto-constructed via cached interface-ctor lookup\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","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"}