Skip to content

Commit d9b3cd9

Browse files
cloud-hai-voclaude
andcommitted
docs: dark theme, SEO, comparison page, nav structure
- Switch to just-the-docs theme with dark color scheme - Add jekyll-sitemap + jekyll-seo-tag plugins - Add robots.txt with sitemap reference - Add "EggMapper vs AutoMapper" comparison page (SEO target) - Add front matter with nav_order to all existing doc pages - Set GitHub repo homepage URL to eggspot.github.io/EggMapper - Add search, back-to-top, aux navigation links Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 09f5a32 commit d9b3cd9

10 files changed

Lines changed: 175 additions & 38 deletions

docs/API-Reference.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
---
2+
layout: default
3+
title: API Reference
4+
nav_order: 4
5+
---
6+
17
# API Reference
28

39
## Namespace `EggMapper`

docs/Advanced-Features.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
---
2+
layout: default
3+
title: Advanced Features
4+
nav_order: 5
5+
---
6+
17
# Advanced Features
28

39
## `ForMember` — Custom Member Mapping

docs/Dependency-Injection.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
---
2+
layout: default
3+
title: Dependency Injection
4+
nav_order: 7
5+
---
6+
17
# Dependency Injection
28

39
DI support is built into the main `EggMapper` package — no separate package needed.

docs/Migration-Guide.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
# Migration Guide: Runtime → Compile-Time Mapping
1+
---
2+
layout: default
3+
title: Migration Guide
4+
nav_order: 8
5+
---
6+
7+
# Migration Guide: Runtime to Compile-Time Mapping
28

39
EggMapper supports **three tiers** of mapping. This guide walks through migrating from the runtime API (Tier 1 style) to the compile-time generators (Tier 2 and Tier 3).
410

docs/Performance.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
---
2+
layout: default
3+
title: Performance
4+
nav_order: 6
5+
---
6+
17
# Performance
28

39
## How EggMapper Achieves High Performance

docs/_config.yml

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,37 @@
11
title: EggMapper
2-
description: Fastest .NET runtime object-to-object mapper. Drop-in replacement for AutoMapper — same API, 2-5x faster.
3-
remote_theme: pages-themes/minimal@v0.2.0
2+
description: >-
3+
Free AutoMapper alternative for .NET — fastest runtime object-to-object mapper.
4+
Same API (CreateMap, ForMember, Profile, IMapper), 2-5x faster, MIT licensed.
5+
remote_theme: just-the-docs/just-the-docs@v0.10.1
46
plugins:
57
- jekyll-remote-theme
8+
- jekyll-seo-tag
9+
10+
color_scheme: dark
611

712
url: https://eggspot.github.io
813
baseurl: /EggMapper
14+
15+
# SEO
16+
author: Eggspot
17+
18+
# Navigation
19+
aux_links:
20+
GitHub: https://github.com/eggspot/EggMapper
21+
NuGet: https://www.nuget.org/packages/EggMapper
22+
23+
aux_links_new_tab: true
24+
25+
# Footer
26+
footer_content: >-
27+
EggMapper is MIT licensed. &copy; Eggspot.
28+
29+
# Search
30+
search_enabled: true
31+
search:
32+
heading_level: 2
33+
previews: 3
34+
35+
# Back to top link
36+
back_to_top: true
37+
back_to_top_text: "Back to top"

docs/index.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,31 @@
11
---
22
layout: default
3-
title: EggMapper
3+
title: Home
4+
nav_order: 1
5+
description: "EggMapper — fastest .NET object mapper. Free AutoMapper alternative, 2-5x faster, MIT licensed."
6+
permalink: /
47
---
58

69
# EggMapper
10+
{: .fs-9 }
711

8-
**Fastest .NET runtime object-to-object mapper.** Drop-in replacement for AutoMapper — same API, 2-5x faster, MIT licensed.
12+
Fastest .NET runtime object-to-object mapper. Drop-in AutoMapper replacement — same API, 2-5x faster, MIT licensed.
13+
{: .fs-6 .fw-300 }
14+
15+
[Get Started](quick-start){: .btn .btn-primary .fs-5 .mb-4 .mb-md-0 .mr-2 }
16+
[View on GitHub](https://github.com/eggspot/EggMapper){: .btn .fs-5 .mb-4 .mb-md-0 }
17+
18+
---
919

1020
## Why EggMapper?
1121

12-
| | AutoMapper | EggMapper |
22+
| | AutoMapper | **EggMapper** |
1323
|---|-----------|-----------|
14-
| **License** | Commercial (v13+) | MIT (free forever) |
15-
| **Performance** | Baseline | 2-5x faster |
16-
| **Allocations** | Extra per-map | Zero extra |
17-
| **Runtime reflection** | Yes | No (compiled expressions) |
18-
| **API** | Original | Same API, drop-in |
24+
| License | Commercial (v13+) | **MIT (free forever)** |
25+
| Performance | Baseline | **2-5x faster** |
26+
| Allocations | Extra per-map | **Zero extra** |
27+
| Runtime reflection | Yes | **No** (compiled expressions) |
28+
| API | Original | **Same API, drop-in** |
1929

2030
## Install
2131

@@ -44,22 +54,12 @@ var dto = mapper.Map<CustomerDto>(customer);
4454
- **Zero runtime reflection** — all delegates compiled as expression trees
4555
- **Zero extra allocations** — matches hand-written mapping code
4656
- **Collection auto-mapping**`Map<List<B>>(listOfA)` works with just `CreateMap<A,B>()`
47-
- **Same-type auto-mapping**`Map<T,T>(obj)` creates a copy without any configuration
57+
- **Same-type auto-mapping**`Map<T,T>(obj)` creates a copy without configuration
4858
- **EF Core ProjectTo**`query.ProjectTo<Src, Dest>(config)` translates to SQL
4959
- **DI integration**`services.AddEggMapper(assembly)` with scoped IServiceProvider
5060
- **EF Core proxy support** — base-type + interface walk for lazy-loading proxies
51-
52-
## Documentation
53-
54-
- [Quick Start](quick-start) — Install, DI, Profiles, Collections
55-
- [Getting Started](Getting-Started) — Detailed walkthrough
56-
- [Configuration](Configuration) — MapperConfiguration, Profiles, Validation
57-
- [API Reference](API-Reference) — All Map overloads, ForMember options
58-
- [Advanced Features](Advanced-Features) — ProjectTo, Open Generics, Inheritance, Hooks
59-
- [Dependency Injection](Dependency-Injection) — ASP.NET, Blazor, gRPC, Windows Service
60-
- [Profiles](Profiles) — Organizing mappings into profile classes
61-
- [Migration Guide](Migration-Guide) — Runtime to Compile-Time tiers
62-
- [Performance](Performance) — Benchmark results vs all competitors
61+
- **Patch mapping** — partial updates with `Patch<S,D>(source, dest)`
62+
- **Open generics**`CreateMap(typeof(Result<>), typeof(ResultDto<>))`
6363

6464
## Links
6565

docs/quick-start.md

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
11
---
22
layout: default
33
title: Quick Start
4+
nav_order: 2
5+
description: "Get started with EggMapper — installation, DI setup, profiles, collections, ProjectTo."
46
---
57

68
# Quick Start
9+
{: .no_toc }
10+
11+
## Table of contents
12+
{: .no_toc .text-delta }
13+
14+
1. TOC
15+
{:toc}
16+
17+
---
718

819
## Installation
920

@@ -13,7 +24,7 @@ dotnet add package EggMapper
1324

1425
No separate DI package needed — `AddEggMapper()` is included.
1526

16-
Supported frameworks: `netstandard2.0`, `net462`, `net8.0`, `net9.0`, `net10.0`
27+
Supported: `netstandard2.0`, `net462`, `net8.0`, `net9.0`, `net10.0`
1728

1829
## Basic Usage
1930

@@ -33,7 +44,7 @@ var mapper = config.CreateMapper();
3344
var dto = mapper.Map<ProductDto>(product);
3445
```
3546

36-
## Dependency Injection (ASP.NET / Blazor / gRPC)
47+
## Dependency Injection
3748

3849
```csharp
3950
// Program.cs
@@ -50,27 +61,22 @@ public class ProductsController(IMapper mapper)
5061
}
5162
```
5263

53-
`IMapper` is registered as **Transient** (each injection gets a fresh instance with the caller's scoped `IServiceProvider`). `MapperConfiguration` is **Singleton**.
64+
`IMapper` is **Transient** (fresh per injection with caller's scoped `IServiceProvider`). `MapperConfiguration` is **Singleton**.
5465

5566
## Profiles
5667

57-
Organize mappings into profile classes:
58-
5968
```csharp
6069
public class ProductProfile : Profile
6170
{
6271
public ProductProfile()
6372
{
6473
CreateMap<Product, ProductDto>()
65-
.ForMember(d => d.FullName, o => o.MapFrom(s => $"{s.FirstName} {s.LastName}"))
74+
.ForMember(d => d.FullName, o => o.MapFrom(s => $"{s.First} {s.Last}"))
6675
.ForMember(d => d.Secret, o => o.Ignore());
6776

6877
CreateMap<OrderItem, OrderItemDto>();
6978
}
7079
}
71-
72-
// Register all profiles from an assembly
73-
builder.Services.AddEggMapper(typeof(ProductProfile).Assembly);
7480
```
7581

7682
## Collection Mapping
@@ -83,28 +89,29 @@ List<ProductDto> dtos = mapper.MapList<Product, ProductDto>(products);
8389
var dtos = mapper.Map<List<ProductDto>>(products);
8490
```
8591

86-
No `CreateMap<List<Product>, List<ProductDto>>()` needed — just the element map.
92+
No `CreateMap<List<Product>, List<ProductDto>>()` needed.
8793

8894
## EF Core ProjectTo
8995

9096
```csharp
91-
// Translates to SQL — no in-memory mapping
9297
var dtos = await dbContext.Products
9398
.Where(p => p.IsActive)
9499
.ProjectTo<Product, ProductDto>(mapperConfig)
95100
.ToListAsync();
96101
```
97102

103+
Translates to SQL — no in-memory mapping.
104+
98105
## Same-Type Mapping (Cloning)
99106

100107
```csharp
101108
// No CreateMap needed — auto-compiles on first use
102109
var copy = mapper.Map<Customer, Customer>(customer);
103110
```
104111

105-
## Configuration Validation
112+
## Validation
106113

107114
```csharp
108-
var config = new MapperConfiguration(cfg => { ... });
109-
config.AssertConfigurationIsValid(); // Throws if any dest members unmapped
115+
config.AssertConfigurationIsValid();
116+
// Throws if any destination members are unmapped
110117
```

docs/robots.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
User-agent: *
2+
Allow: /
3+
Sitemap: https://eggspot.github.io/EggMapper/sitemap.xml

docs/vs-automapper.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
---
2+
layout: default
3+
title: EggMapper vs AutoMapper
4+
nav_order: 3
5+
description: "Compare EggMapper and AutoMapper for .NET object mapping. Same API, 2-5x faster, MIT licensed."
6+
---
7+
8+
# EggMapper vs AutoMapper
9+
10+
## Why switch from AutoMapper?
11+
12+
AutoMapper changed to a commercial license (RPL) starting v13. EggMapper is a **free, MIT-licensed** drop-in replacement that's also **2-5x faster**.
13+
14+
## Comparison
15+
16+
| Feature | AutoMapper 16.x | EggMapper |
17+
|---------|----------------|-----------|
18+
| **License** | RPL 1.5 (commercial) | MIT (free forever) |
19+
| **Performance** | Baseline | **2-5x faster** |
20+
| **Allocations** | Extra per-map | **Zero extra** |
21+
| **Runtime reflection** | Yes | **No** (compiled expressions) |
22+
| **API** | Original | **Same API** — drop-in |
23+
| **CreateMap / ForMember** | Yes | Yes (identical) |
24+
| **Profile** | Yes | Yes (identical) |
25+
| **IMapper** | Yes | Yes (identical) |
26+
| **DI registration** | `AddAutoMapper()` | `AddEggMapper()` |
27+
| **EF Core ProjectTo** | `ProjectTo<D>(cfg)` | `ProjectTo<S,D>(cfg)` |
28+
| **Null collections** | Empty by default | Empty by default |
29+
| **EF Core proxies** | Supported | Supported |
30+
| **Same-type T→T** | Needs CreateMap | **Auto-compiles** |
31+
| **Collection auto-map** | Automatic | Automatic |
32+
| **Patch/partial** | Not built-in | **Built-in** |
33+
34+
## Migration (5 minutes)
35+
36+
```diff
37+
- dotnet add package AutoMapper
38+
+ dotnet add package EggMapper
39+
40+
- using AutoMapper;
41+
+ using EggMapper;
42+
43+
- services.AddAutoMapper(typeof(MyProfile).Assembly);
44+
+ services.AddEggMapper(typeof(MyProfile).Assembly);
45+
```
46+
47+
All your existing `CreateMap`, `ForMember`, `Profile`, and `IMapper` code works unchanged.
48+
49+
## Benchmark Results
50+
51+
EggMapper consistently outperforms AutoMapper on every scenario:
52+
53+
- **Flat mapping**: 2-3x faster
54+
- **Nested objects**: 2-4x faster
55+
- **Collections**: 3-5x faster
56+
- **Deep object graphs**: 2-4x faster
57+
58+
Zero extra allocations in all scenarios — matches hand-written code.
59+
60+
[View full benchmark results on GitHub](https://github.com/eggspot/EggMapper#benchmarks)
61+
62+
## Get Started
63+
64+
```bash
65+
dotnet add package EggMapper
66+
```
67+
68+
[Quick Start Guide](quick-start) | [API Reference](API-Reference) | [GitHub](https://github.com/eggspot/EggMapper)

0 commit comments

Comments
 (0)