Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 26 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# RSCG - 271 Examples of Roslyn Source Code Generators / 16 created by Microsoft /
# RSCG - 272 Examples of Roslyn Source Code Generators / 16 created by Microsoft /

The RSCG_Examples repository is a comprehensive documentation system that automatically processes and showcases 271 Roslyn Source Code Generator (RSCG) examples. The system transforms individual RSCG projects into structured documentation with code examples and cross-referenced content with a searchable website and code example exports.
The RSCG_Examples repository is a comprehensive documentation system that automatically processes and showcases 272 Roslyn Source Code Generator (RSCG) examples. The system transforms individual RSCG projects into structured documentation with code examples and cross-referenced content with a searchable website and code example exports.

This system serves as both a learning resource for .NET developers interested in source generators and an automated pipeline for maintaining up-to-date documentation about the RSCG ecosystem

## Latest Update : 2026-05-16 => 16 May 2026
## Latest Update : 2026-06-29 => 29 June 2026

If you want to see examples with code, please click ***[List V2](https://ignatandrei.github.io/RSCG_Examples/v2/docs/List-of-RSCG)***

Expand All @@ -24,8 +24,30 @@ If you want to be notified each time I add a new RSCG example , please click htt

## Content

Those are the 271 Roslyn Source Code Generators that I have tested you can see and download source code example.
Those are the 272 Roslyn Source Code Generators that I have tested you can see and download source code example.
( including 16 from Microsoft )
### 272. [AlephMapper](https://ignatandrei.github.io/RSCG_Examples/v2/docs/AlephMapper) , in the [Database](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#database) category

Generated on : 2026-06-29 => 29 June 2026

<details>
<summary>Expand</summary>



Author: Yevhen Cherkes

Source generator for creating projectable companions

Nuget: [https://www.nuget.org/packages/AlephMapper/](https://www.nuget.org/packages/AlephMapper/)


Link: [https://ignatandrei.github.io/RSCG_Examples/v2/docs/AlephMapper](https://ignatandrei.github.io/RSCG_Examples/v2/docs/AlephMapper)

Source: [https://github.com/Raffinert/AlephMapper](https://github.com/Raffinert/AlephMapper)

</details>

### 271. [TypedStateBuilder.Generator](https://ignatandrei.github.io/RSCG_Examples/v2/docs/TypedStateBuilder.Generator) , in the [Builder](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#builder) category

Generated on : 2026-05-16 => 16 May 2026
Expand Down
2 changes: 1 addition & 1 deletion later.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Just later

## Latest Update : 2026-05-16 => 16 May 2026
## Latest Update : 2026-06-29 => 29 June 2026



Expand Down
3 changes: 3 additions & 0 deletions v2/Generator/MultiGeneratorV2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ public string[] SourceNoRSCG()
if (File.Exists(nameFile))
{
var text=await File.ReadAllTextAsync(nameFile);
text = text.Replace("(examples/", $"({d.Generator!.Source}/examples/");
text = text.Replace("(tests/", $"({d.Generator!.Source}/tests/");

text = text.Replace("(/.github/", $"({d.Generator!.Source}/.github/");
text = text.Replace("(BenchmarkDotNet", $"({d.Generator!.Source}/BenchmarkDotNet");
text = text.Replace("(./BoolParameterGenerator.Github.Example/", $"({d.Generator!.Source}/BoolParameterGenerator.Github.Example/");
Expand Down
1 change: 1 addition & 0 deletions v2/Generator/all.csv
Original file line number Diff line number Diff line change
Expand Up @@ -270,3 +270,4 @@ Nr,Key,Source,Category
269,LinkDotNet.Enumeration, https://github.com/linkdotnet/Enumeration,Enum
270,AssemblyMetadata.Generators, https://github.com/loresoft/AssemblyMetadata.Generators,EnhancementProject
271,TypedStateBuilder.Generator, https://github.com/Georgiy-Petrov/TypedStateBuilder.Generator,Builder
272,AlephMapper, https://github.com/Raffinert/AlephMapper,Database
6 changes: 6 additions & 0 deletions v2/RSCGExamplesData/GeneratorDataRec.json
Original file line number Diff line number Diff line change
Expand Up @@ -1642,5 +1642,11 @@
"Category": 4,
"dtStart": "2026-05-16T00:00:00",
"show": true
},
{
"ID":"AlephMapper",
"Category": 14,
"dtStart": "2026-06-29T00:00:00",
"show": true
}
]
70 changes: 70 additions & 0 deletions v2/book/examples/AlephMapper.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@

<h1>RSCG nr 272 : AlephMapper</h1>

<h2>Info</h2>
Nuget : <a href="https://www.nuget.org/packages/AlephMapper/" target="_blank">https://www.nuget.org/packages/AlephMapper/</a>

<p>You can find more details at : <a href="https://github.com/Raffinert/AlephMapper" target="_blank"> https://github.com/Raffinert/AlephMapper</a></p>

<p>Author :Yevhen Cherkes</p>

<p>Source: <a href="https://github.com/Raffinert/AlephMapper" target="_blank">https://github.com/Raffinert/AlephMapper</a> </p>

<h2>About</h2>

AlephMapper helps you define LINQ-translatable object mappers for EF Core.It turns a normal C# mapping method into an expression that can be embedded in queries, so your entity-to-DTO projection can run inside the database query instead of after materialization.This is useful for cleaner projection code, avoiding hand-written select expressions, and keeping mapping logic reusable across queries.

<h2>
How to use
</h2>
<h3>
Add reference to the <a href="https://www.nuget.org/packages/AlephMapper/" target="_blank">AlephMapper</a> in the csproj
</h3>
<img src="images/AlephMapper/EntityDemo.csproj.png" width="580" height="580" />

<h3>This was for me the <b>starting</b> code</h3>

<br />
I have <b>coded</b> the file Program.cs
<br />
<img src="images/AlephMapper/csFiles/Program.cs.png" width="580" height="580" />
<hr />

<br />
I have <b>coded</b> the file ProjectExtensions.cs
<br />
<img src="images/AlephMapper/csFiles/ProjectExtensions.cs.png" width="580" height="580" />
<hr />

<br />
I have <b>coded</b> the file ProjectDTO.cs
<br />
<img src="images/AlephMapper/csFiles/ProjectDTO.cs.png" width="580" height="580" />
<hr />
<h3>And here are the <i>generated</i> files</h3>

<br />
The file <i>generated</i> is AlephMapper.Attributes.g.cs
<br />
<img src="images/AlephMapper/generated/AlephMapper.Attributes.g.cs.png" width="580" height="580" />

<br />
The file <i>generated</i> is EntityDemo_ProjectExtensions_GeneratedMappings.g.cs
<br />
<img src="images/AlephMapper/generated/EntityDemo_ProjectExtensions_GeneratedMappings.g.cs.png" width="580" height="580" />

<p>
You can download the code and this page as pdf from
<a target="_blank" href='https://ignatandrei.github.io/RSCG_Examples/v2/docs/AlephMapper'>
https://ignatandrei.github.io/RSCG_Examples/v2/docs/AlephMapper
</a>
</p>


<p>
You can see the whole list at
<a target="_blank" href='https://ignatandrei.github.io/RSCG_Examples/v2/docs/List-of-RSCG'>
https://ignatandrei.github.io/RSCG_Examples/v2/docs/List-of-RSCG
</a>
</p>

2 changes: 1 addition & 1 deletion v2/book/examples/TypedStateBuilder.Generator.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ <h2>Info</h2>

<h2>About</h2>

Generate strongly typed state builders for C# applications, improving code readability and maintainability.
Generate strongly typed state builders for C# applications, enforced at compile time**Summary of TypedStateBuilder.Generator****Purpose:** Generates compile-time safe step-by-step builders using the *type-state pattern* — each required property must be set in order before Build() is available, enforced at compile time.**NuGet:** https://www.nuget.org/packages/TypedStateBuilder.Generator/**GitHub:** https://github.com/Georgiy-Petrov/TypedStateBuilder.Generator**Author:** Georgiy Petrov**How to use:**1. Decorate a builder class with [TypedStateBuilder], mark each required step with [StepForValue], and optionally add [ValidateValue] for validation:```csharp[TypedStateBuilder]public class PersonBuilder{ [StepForValue] [ValidateValue(nameof(ValidateName))] private string lastName = string.Empty; [StepForValue] [ValidateValue(nameof(ValidateName))] private string firstName = string.Empty; public void ValidateName(string name) { if (string.IsNullOrWhiteSpace(name) || name.Length &lt;= 1) throw new ArgumentException(&quot;Name must be at least 2 characters long.&quot;); } [Build] public Person Build() =&gt; new Person(firstName, lastName);}```2. Use the generated fluent builder — steps are enforced in order at compile time:```csharpvar p = TypedStateBuilders .CreatePersonBuilder() .SetFirstName(&quot;Andrei&quot;) .SetLastName(&quot;Ignat&quot;) .Build();Console.WriteLine(p.FullName()); // &quot;Andrei Ignat&quot;```

<h2>
How to use
Expand Down
6 changes: 5 additions & 1 deletion v2/book/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</head>
<body>
<h1>
This is the list of 271 RSCG with examples =>
This is the list of 272 RSCG with examples =>
</h1>

<table >
Expand Down Expand Up @@ -1110,6 +1110,10 @@ <h1>
<td>271</td>
<td><a href="examples/TypedStateBuilder.Generator.html">TypedStateBuilder.Generator</a></td>
</tr>
<tr>
<td>272</td>
<td><a href="examples/AlephMapper.html">AlephMapper</a></td>
</tr>
</table>


Expand Down
1 change: 1 addition & 0 deletions v2/book/pandocHTML.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ input-files:
- examples/LinkDotNet.Enumeration.html
- examples/AssemblyMetadata.Generators.html
- examples/TypedStateBuilder.Generator.html
- examples/AlephMapper.html

# or you may use input-file: with a single value
# defaults:
Expand Down
6 changes: 6 additions & 0 deletions v2/docFind.json
Original file line number Diff line number Diff line change
Expand Up @@ -1624,5 +1624,11 @@
"category": "Builder",
"href": "/RSCG_Examples/v2/docs/TypedStateBuilder.Generator/",
"body": "A Roslyn source generator that produces **compile-time safe builders** using the *type-state pattern*."
},
{
"title": "AlephMapper",
"category": "Database",
"href": "/RSCG_Examples/v2/docs/AlephMapper/",
"body": "Source generator for creating projectable companions"
}
]
25 changes: 25 additions & 0 deletions v2/rscg_examples/AlephMapper/description.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"generator":{
"name":"AlephMapper",
"nuget":[
"https://www.nuget.org/packages/AlephMapper/"
],
"link":"https://github.com/Raffinert/AlephMapper",
"author":"Yevhen Cherkes",
"source":"https://github.com/Raffinert/AlephMapper"
},
"data":{
"goodFor":["AlephMapper helps you define LINQ-translatable object mappers for EF Core.",
"It turns a normal C# mapping method into an expression that can be embedded in queries, so your entity-to-DTO projection can run inside the database query instead of after materialization.",
"This is useful for cleaner projection code, avoiding hand-written select expressions, and keeping mapping logic reusable across queries."
],
"csprojDemo":"EntityDemo.csproj",
"csFiles":["Program.cs","ProjectExtensions.cs","ProjectDTO.cs"],
"excludeDirectoryGenerated":[""],
"includeAdditionalFiles":[""]
},
"links":{
"blog":"",
"video":""
}
}
1 change: 1 addition & 0 deletions v2/rscg_examples/AlephMapper/nuget.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Source generator for creating projectable companions
Loading
Loading