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
34 changes: 29 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# RSCG - 240 Examples of Roslyn Source Code Generators / 16 created by Microsoft /
# RSCG - 241 Examples of Roslyn Source Code Generators / 16 created by Microsoft /

The RSCG_Examples repository is a comprehensive documentation system that automatically processes and showcases 240 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 241 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 : 2025-11-09 => 09 November 2025
## Latest Update : 2025-11-10 => 10 November 2025

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

If you want just those from Microsoft, please click ***[Microsoft](https://ignatandrei.github.io/RSCG_Examples/v2/docs/category/microsoft-examples)***

If you want to see by category, please click ***[category](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples)***
or click any category below
[actor](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#actor) -[ai](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#ai) -[aop](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#aop) -[api](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#api) -[async](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#async) -[bitwise](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#bitwise) -[blazor](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#blazor) -[builder](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#builder) -[clone](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#clone) -[codetostring](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#codetostring) -[commandline](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#commandline) -[console](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#console) -[constructor](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#constructor) -[database](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#database) -[dependencyinjection](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#dependencyinjection) -[disposer](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#disposer) -[enhancementclass](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#enhancementclass) -[enhancementproject](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#enhancementproject) -[enum](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#enum) -[equals](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#equals) -[filestocode](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#filestocode) -[functionalprogramming](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#functionalprogramming) -[hangfire](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#hangfire) -[interface](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#interface) -[linq](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#linq) -[mapper](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#mapper) -[mediator](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#mediator) -[mixin](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#mixin) -[mvc](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#mvc) -[mvvm](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#mvvm) -[optimizer](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#optimizer) -[primitiveobsession](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#primitiveobsession) -[rx](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#rx) -[serializer](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#serializer) -[signalr](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#signalr) -[statemachine](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#statemachine) -[templating](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#templating) -[tests](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#tests) -[validator](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#validator) -[winapi](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#winapi) -
[actor](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#actor) -[ai](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#ai) -[aop](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#aop) -[api](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#api) -[async](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#async) -[bitwise](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#bitwise) -[blazor](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#blazor) -[builder](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#builder) -[clone](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#clone) -[codetostring](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#codetostring) -[commandline](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#commandline) -[console](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#console) -[constructor](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#constructor) -[database](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#database) -[decorator](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#decorator) -[dependencyinjection](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#dependencyinjection) -[disposer](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#disposer) -[enhancementclass](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#enhancementclass) -[enhancementproject](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#enhancementproject) -[enum](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#enum) -[equals](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#equals) -[filestocode](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#filestocode) -[functionalprogramming](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#functionalprogramming) -[hangfire](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#hangfire) -[interface](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#interface) -[linq](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#linq) -[mapper](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#mapper) -[mediator](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#mediator) -[mixin](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#mixin) -[mvc](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#mvc) -[mvvm](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#mvvm) -[optimizer](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#optimizer) -[primitiveobsession](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#primitiveobsession) -[rx](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#rx) -[serializer](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#serializer) -[signalr](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#signalr) -[statemachine](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#statemachine) -[templating](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#templating) -[tests](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#tests) -[validator](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#validator) -[winapi](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#winapi) -


## If you have a Roslyn Source Code Generator, please create an issue.
Expand All @@ -24,8 +24,32 @@ If you want to be notified each time I add a new RSCG example , please click htt

## Content

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

Generated on : 2025-11-10 => 10 November 2025

<details>
<summary>Expand</summary>



Author: Leopoldo Fu

Source generator for decorator pattern boilerplate code in C#.

When implementing the decorator pattern in C#, it requires adding boilerplate code for every interface that needs to support decorators, namely the abstract class. Boilerplate is tedious to write and error-prone. This source generator solves this problem by automatically generating the abstract class. It only needs to be told which interfaces it should generate the abstract class for.

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


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

Source: [https://github.com/CodingFlow/decorator-generator](https://github.com/CodingFlow/decorator-generator)

</details>
Comment on lines +29 to +51
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify the external links for DecoratorGenerator entry
echo "Checking NuGet package URL..."
curl -s -o /dev/null -w "NuGet Package: HTTP Status %{http_code}\n" "https://www.nuget.org/packages/DecoratorGenerator/"

echo "Checking GitHub repository URL..."
curl -s -o /dev/null -w "GitHub Repo: HTTP Status %{http_code}\n" "https://github.com/CodingFlow/decorator-generator"

echo "Checking documentation URL..."
curl -s -o /dev/null -w "Documentation: HTTP Status %{http_code}\n" "https://ignatandrei.github.io/RSCG_Examples/v2/docs/DecoratorGenerator"

Repository: ignatandrei/RSCG_Examples

Length of output: 253


Documentation link is broken (404) — needs correction before merge.

Verification results:

  • ✅ NuGet Package: HTTP 200 (valid)
  • ✅ GitHub Repository: HTTP 200 (valid)
  • ❌ Documentation: HTTP 404 (broken link)

The documentation URL https://ignatandrei.github.io/RSCG_Examples/v2/docs/DecoratorGenerator returns a 404 error. This link should be removed or corrected to point to a valid documentation page before merging.

🤖 Prompt for AI Agents
In README.md around lines 29 to 51 the documentation URL
https://ignatandrei.github.io/RSCG_Examples/v2/docs/DecoratorGenerator returns
404; fix by either removing the broken documentation link or replacing it with a
valid URL (for example the repository README:
https://github.com/CodingFlow/decorator-generator or the NuGet package page) and
update the "Link:" and the expanded details block so both point to the
corrected/working documentation URL; ensure no lingering references to the
broken ignatandrei.github.io URL remain.


### 240. [XmlCommentGenerator](https://ignatandrei.github.io/RSCG_Examples/v2/docs/XmlCommentGenerator) , in the [API](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#api) category

Generated on : 2025-11-09 => 09 November 2025
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 : 2025-11-09 => 09 November 2025
## Latest Update : 2025-11-10 => 10 November 2025



Expand Down
48 changes: 48 additions & 0 deletions v2/.tours/DecoratorGenerator.tour
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@

{
"$schema": "https://aka.ms/codetour-schema",
"title": "DecoratorGenerator",
"steps":
[
{
"file": "rscg_examples/DecoratorGenerator/src/DecoratorDemo/DecoratorDemo.csproj",
"description": "First, we add Nuget [DecoratorGenerator](https://www.nuget.org/packages/DecoratorGenerator/) in csproj ",
"pattern": "DecoratorGenerator"
}

,{
"file": "rscg_examples/DecoratorGenerator/src/DecoratorDemo/LogPerson.cs",
"description": "File LogPerson.cs ",
"pattern": "this is the code"
}

,{
"file": "rscg_examples/DecoratorGenerator/src/DecoratorDemo/IPerson.cs",
"description": "File IPerson.cs ",
"pattern": "this is the code"
}

,{
"file": "rscg_examples/DecoratorGenerator/src/DecoratorDemo/Person.cs",
"description": "File Person.cs ",
"pattern": "this is the code"
}

,{
"file": "rscg_examples/DecoratorGenerator/src/DecoratorDemo/Program.cs",
"description": "File Program.cs \r\n>> dotnet run --project rscg_examples/DecoratorGenerator/src/DecoratorDemo/DecoratorDemo.csproj ",
"pattern": "this is the code"
}


,{
"file": "rscg_examples/DecoratorGenerator/src/DecoratorDemo/obj/GX/DecoratorGenerator/DecoratorGenerator.Main/PersonDecorator.generated.cs",
"description": "Generated File 1 from 1 : PersonDecorator.generated.cs ",
"line": 1
}

],

"ref": "main"

}
1 change: 1 addition & 0 deletions v2/Generator/all.csv
Original file line number Diff line number Diff line change
Expand Up @@ -239,3 +239,4 @@ Nr,Key,Source,Category
238,TeCLI, https://github.com/tyevco/TeCLI,CommandLine
239,TUnit, https://github.com/thomhurst/TUnit,Tests
240,XmlCommentGenerator, https://github.com/dotnet/dotnet/,API
241,DecoratorGenerator, https://github.com/CodingFlow/decorator-generator,Decorator
1 change: 1 addition & 0 deletions v2/GeneratorData/Category.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,6 @@ public enum Category
RX=38,
Mixin=39,
Validator=40,
Decorator= 41
}

6 changes: 6 additions & 0 deletions v2/RSCGExamplesData/GeneratorDataRec.json
Original file line number Diff line number Diff line change
Expand Up @@ -1453,5 +1453,11 @@
"Category":15,
"dtStart": "2025-11-09T00:00:00",
"show": true
},
{
"ID":"DecoratorGenerator",
"Category":41,
"dtStart": "2025-11-10T00:00:00",
"show": true
}
]
71 changes: 71 additions & 0 deletions v2/book/examples/DecoratorGenerator.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@

<h1>RSCG nr 241 : DecoratorGenerator</h1>

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

<p>You can find more details at : <a href="https://github.com/CodingFlow/decorator-generator" target="_blank"> https://github.com/CodingFlow/decorator-generator</a></p>

<p>Author :Leopoldo Fu</p>

<p>Source: <a href="https://github.com/CodingFlow/decorator-generator" target="_blank">https://github.com/CodingFlow/decorator-generator</a> </p>

<h2>About</h2>

adding decorator for classes/ interfaces

<h2>
How to use
</h2>
<h3>
Add reference to the <a href="https://www.nuget.org/packages/DecoratorGenerator/" target="_blank">DecoratorGenerator</a> in the csproj
</h3>
<img src="images/DecoratorGenerator/DecoratorDemo.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/DecoratorGenerator/csFiles/Program.cs.png" width="580" height="580" />
<hr />

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

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

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

<br />
The file <i>generated</i> is PersonDecorator.generated.cs
<br />
<img src="images/DecoratorGenerator/generated/PersonDecorator.generated.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/DecoratorGenerator'>
https://ignatandrei.github.io/RSCG_Examples/v2/docs/DecoratorGenerator
</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>

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 240 RSCG with examples =>
This is the list of 241 RSCG with examples =>
</h1>

<table >
Expand Down Expand Up @@ -986,6 +986,10 @@ <h1>
<td>240</td>
<td><a href="examples/XmlCommentGenerator.html">XmlCommentGenerator</a></td>
</tr>
<tr>
<td>241</td>
<td><a href="examples/DecoratorGenerator.html">DecoratorGenerator</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 @@ -254,6 +254,7 @@ input-files:
- examples/TeCLI.html
- examples/TUnit.html
- examples/XmlCommentGenerator.html
- examples/DecoratorGenerator.html

# or you may use input-file: with a single value
# defaults:
Expand Down
22 changes: 22 additions & 0 deletions v2/rscg_examples/DecoratorGenerator/description.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"generator":{
"name":"DecoratorGenerator",
"nuget":[
"https://www.nuget.org/packages/DecoratorGenerator/"
],
"link":"https://github.com/CodingFlow/decorator-generator",
"author":"Leopoldo Fu",
"source":"https://github.com/CodingFlow/decorator-generator"
},
"data":{
"goodFor":["adding decorator for classes/ interfaces"],
"csprojDemo":"DecoratorDemo.csproj",
"csFiles":["Program.cs","Person.cs","IPerson.cs","LogPerson.cs"],
"excludeDirectoryGenerated":[""],
"includeAdditionalFiles":[""]
},
"links":{
"blog":"",
"video":""
}
}
3 changes: 3 additions & 0 deletions v2/rscg_examples/DecoratorGenerator/nuget.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Source generator for decorator pattern boilerplate code in C#.

When implementing the decorator pattern in C#, it requires adding boilerplate code for every interface that needs to support decorators, namely the abstract class. Boilerplate is tedious to write and error-prone. This source generator solves this problem by automatically generating the abstract class. It only needs to be told which interfaces it should generate the abstract class for.
Loading
Loading