Skip to content

Commit 274d3a1

Browse files
authored
Merge pull request #422 from ignatandrei/ProgramAspCore
2 parents 75f3d0e + d85203b commit 274d3a1

36 files changed

Lines changed: 760 additions & 102 deletions

README.md

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# RSCG - 236 Examples of Roslyn Source Code Generators / 14 created by Microsoft /
1+
# RSCG - 237 Examples of Roslyn Source Code Generators / 15 created by Microsoft /
22

3-
The RSCG_Examples repository is a comprehensive documentation system that automatically processes and showcases 236 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.
3+
The RSCG_Examples repository is a comprehensive documentation system that automatically processes and showcases 237 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.
44

55
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
66

7-
## Latest Update : 2025-10-06 => 06 October 2025
7+
## Latest Update : 2025-11-06 => 06 November 2025
88

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

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

2525
## Content
2626

27-
Those are the 236 Roslyn Source Code Generators that I have tested you can see and download source code example.
28-
( including 14 from Microsoft )
27+
Those are the 237 Roslyn Source Code Generators that I have tested you can see and download source code example.
28+
( including 15 from Microsoft )
29+
### 237. [Program](https://ignatandrei.github.io/RSCG_Examples/v2/docs/Program) , in the [EnhancementClass](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#enhancementclass) category
30+
31+
Generated on : 2025-11-06 => 06 November 2025
32+
33+
<details>
34+
<summary>Expand</summary>
35+
36+
37+
38+
Author: Microsoft
39+
40+
Provides APIs for annotating route handler endpoints in ASP.NET Core with OpenAPI annotations.
41+
42+
This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/e77cb01b5529c137130757859f09f892dbdd2436
43+
44+
Nuget: [https://www.nuget.org/packages/Microsoft.AspNetCore.OpenApi](https://www.nuget.org/packages/Microsoft.AspNetCore.OpenApi)
45+
46+
47+
Link: [https://ignatandrei.github.io/RSCG_Examples/v2/docs/Program](https://ignatandrei.github.io/RSCG_Examples/v2/docs/Program)
48+
49+
Source: [https://github.com/dotnet/aspnetcore/](https://github.com/dotnet/aspnetcore/)
50+
51+
</details>
52+
2953
### 236. [validly](https://ignatandrei.github.io/RSCG_Examples/v2/docs/validly) , in the [Validator](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#validator) category
3054

3155
Generated on : 2025-10-06 => 06 October 2025
@@ -114,7 +138,7 @@ Source: [https://github.com/hadashiA/VYaml](https://github.com/hadashiA/VYaml)
114138

115139
</details>
116140

117-
### 232. [ConsoleAppFramework](https://ignatandrei.github.io/RSCG_Examples/v2/docs/ConsoleAppFramework) , in the [Console](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#console) category
141+
### 232. [ConsoleAppFramework](https://ignatandrei.github.io/RSCG_Examples/v2/docs/ConsoleAppFramework) , in the [CommandLine](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#commandline) category
118142

119143
Generated on : 2025-10-02 => 02 October 2025
120144

@@ -2921,7 +2945,7 @@ Source: [https://github.com/bluehands/Funicular-Switch](https://github.com/blueh
29212945

29222946
</details>
29232947

2924-
### 108. [CommandLine](https://ignatandrei.github.io/RSCG_Examples/v2/docs/CommandLine) , in the [EnhancementProject](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#enhancementproject) category
2948+
### 108. [CommandLine](https://ignatandrei.github.io/RSCG_Examples/v2/docs/CommandLine) , in the [CommandLine](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#commandline) category
29252949

29262950
Generated on : 2024-02-11 => 11 February 2024
29272951

later.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Just later
22

3-
## Latest Update : 2025-10-06 => 06 October 2025
3+
## Latest Update : 2025-11-06 => 06 November 2025
44

55

66

v2/.tours/Program.tour

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
2+
{
3+
"$schema": "https://aka.ms/codetour-schema",
4+
"title": "Program",
5+
"steps":
6+
[
7+
{
8+
"file": "rscg_examples/Program/src/TestProgram/TestProgram.csproj",
9+
"description": "First, we add Nuget [Microsoft.AspNetCore.OpenApi](https://www.nuget.org/packages/Microsoft.AspNetCore.OpenApi) in csproj ",
10+
"pattern": "Microsoft.AspNetCore.OpenApi"
11+
}
12+
13+
,{
14+
"file": "rscg_examples/Program/src/TestProgram/Program.cs",
15+
"description": "File Program.cs \r\n>> dotnet run --project rscg_examples/Program/src/TestProgram/TestProgram.csproj ",
16+
"pattern": "this is the code"
17+
}
18+
19+
20+
,{
21+
"file": "rscg_examples/Program/src/TestProgram/obj/GX/Microsoft.AspNetCore.App.SourceGenerators/Microsoft.AspNetCore.SourceGenerators.PublicProgramSourceGenerator/PublicTopLevelProgram.Generated.g.cs",
22+
"description": "Generated File 1 from 1 : PublicTopLevelProgram.Generated.g.cs ",
23+
"line": 1
24+
}
25+
26+
],
27+
28+
"ref": "main"
29+
30+
}

v2/Generator/MultiGeneratorV2.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,20 @@ public string[] SourceNoRSCG()
138138

139139
text = text.Replace("(readme/di.gif)", $"({d.Generator!.Source}/readme/di.gif)");
140140
text = text.Replace("(di.gif)", $"({d.Generator!.Source}/di.gif)");
141+
142+
text = text.Replace("(./docs/", $"({d.Generator!.Source}/docs/");
141143

142144
text = text.Replace("(doc/", $"({d.Generator!.Source}/doc/");
143145
text = text.Replace("(docs/rules/", $"({d.Generator!.Source}/docs/rules/");
144146
text = text.Replace("(CHANGELOG.md", $"({d.Generator!.Source}/CHANGELOG.md");
145147
text = text.Replace("(/.github/CONTRIBUTING.md)", $"({d.Generator!.Source}/.github/CONTRIBUTING.md)");
146148

149+
text = text.Replace("(CONTRIBUTING", $"({d.Generator!.Source}/CONTRIBUTING");
150+
text = text.Replace("(SECURITY", $"({d.Generator!.Source}/SECURITY");
151+
text = text.Replace("(./CODE-OF-CONDUCT", $"({d.Generator!.Source}/CODE-OF-CONDUCT");
152+
153+
154+
147155
text = text.Replace("(img/", $"({d.Generator!.Source}/img/");
148156
text = text.Replace("(RoseLynn.GenericsAnalyzer/)", $"({d.Generator!.Source}/RoseLynn.GenericsAnalyzer/)");
149157
text = text.Replace("(RossLean.", $"({d.Generator!.Source}/RossLean.");

v2/Generator/all.csv

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ Nr,Key,Source,Category
106106
105,Weave, https://github.com/otac0n/Weave,FilesToCode
107107
106,WIAD, https://github.com/ignatandrei/RSCG_WhatIAmDoing,AOP
108108
107,NetAutomaticInterface, https://github.com/codecentric/net_automatic_interface,Interface
109-
108,CommandLine, https://github.com/dotmake-build/command-line,EnhancementProject
109+
108,CommandLine, https://github.com/dotmake-build/command-line,CommandLine
110110
109,FunicularSwitch, https://github.com/bluehands/Funicular-Switch,FunctionalProgramming
111111
110,jab, https://github.com/pakrym/jab,DependencyInjection
112112
111,cachesourcegenerator, https://github.com/jeppevammenkristensen/cachesourcegenerator,FunctionalProgramming
@@ -230,8 +230,9 @@ Nr,Key,Source,Category
230230
229,Facet, https://github.com/Tim-Maes/Facet/,Mapper
231231
230,Unflat, https://github.com/pstlnce/unflat,Database
232232
231,kli.Localize, https://github.com/kl1mm/localize,FilesToCode
233-
232,ConsoleAppFramework, https://github.com/Cysharp/ConsoleAppFramework,Console
233+
232,ConsoleAppFramework, https://github.com/Cysharp/ConsoleAppFramework,CommandLine
234234
233,Vyaml, https://github.com/hadashiA/VYaml,Serializer
235235
234,RapidEnum, https://github.com/hanachiru/RapidEnum,Enum
236236
235,CsvCsharp, https://github.com/nuskey8/Csv-CSharp,Serializer
237237
236,Validly, https://github.com/Hookyns/validly,Validator
238+
237,Program, https://github.com/dotnet/aspnetcore/,EnhancementClass

v2/RSCGExamplesData/GeneratorDataRec.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1428,5 +1428,12 @@
14281428
"Category":40,
14291429
"dtStart": "2025-10-06T00:00:00",
14301430
"show": true
1431+
},
1432+
1433+
{
1434+
"ID":"Program",
1435+
"Category":5,
1436+
"dtStart": "2025-11-06T00:00:00",
1437+
"show": true
14311438
}
14321439
]

v2/book/examples/Program.html

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
2+
<h1>RSCG nr 237 : Program</h1>
3+
4+
<h2>Info</h2>
5+
Nuget : <a href="https://www.nuget.org/packages/Microsoft.AspNetCore.OpenApi" target="_blank">https://www.nuget.org/packages/Microsoft.AspNetCore.OpenApi</a>
6+
7+
<p>You can find more details at : <a href="https://github.com/dotnet/aspnetcore/blob/70d851104f739fb906aabcd6a07c0935ce2549c9/src/Framework/AspNetCoreAnalyzers/src/SourceGenerators/PublicTopLevelProgramGenerator.cs#L11" target="_blank"> https://github.com/dotnet/aspnetcore/blob/70d851104f739fb906aabcd6a07c0935ce2549c9/src/Framework/AspNetCoreAnalyzers/src/SourceGenerators/PublicTopLevelProgramGenerator.cs#L11</a></p>
8+
9+
<p>Author :Microsoft</p>
10+
11+
<p>Source: <a href="https://github.com/dotnet/aspnetcore/" target="_blank">https://github.com/dotnet/aspnetcore/</a> </p>
12+
13+
<h2>About</h2>
14+
15+
Generating Program.cs class for testing purposes
16+
17+
<h2>
18+
How to use
19+
</h2>
20+
<h3>
21+
Add reference to the <a href="https://www.nuget.org/packages/Microsoft.AspNetCore.OpenApi" target="_blank">Program</a> in the csproj
22+
</h3>
23+
<img src="images/Program/TestProgram.csproj.png" width="580" height="580" />
24+
25+
<h3>This was for me the <b>starting</b> code</h3>
26+
27+
<br />
28+
I have <b>coded</b> the file Program.cs
29+
<br />
30+
<img src="images/Program/csFiles/Program.cs.png" width="580" height="580" />
31+
<hr />
32+
<h3>And here are the <i>generated</i> files</h3>
33+
34+
<br />
35+
The file <i>generated</i> is PublicTopLevelProgram.Generated.g.cs
36+
<br />
37+
<img src="images/Program/generated/PublicTopLevelProgram.Generated.g.cs.png" width="580" height="580" />
38+
39+
<p>
40+
You can download the code and this page as pdf from
41+
<a target="_blank" href='https://ignatandrei.github.io/RSCG_Examples/v2/docs/Program'>
42+
https://ignatandrei.github.io/RSCG_Examples/v2/docs/Program
43+
</a>
44+
</p>
45+
46+
47+
<p>
48+
You can see the whole list at
49+
<a target="_blank" href='https://ignatandrei.github.io/RSCG_Examples/v2/docs/List-of-RSCG'>
50+
https://ignatandrei.github.io/RSCG_Examples/v2/docs/List-of-RSCG
51+
</a>
52+
</p>
53+

v2/book/list.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
</head>
1818
<body>
1919
<h1>
20-
This is the list of 236 RSCG with examples =>
20+
This is the list of 237 RSCG with examples =>
2121
</h1>
2222

2323
<table >
@@ -970,6 +970,10 @@ <h1>
970970
<td>236</td>
971971
<td><a href="examples/validly.html">validly</a></td>
972972
</tr>
973+
<tr>
974+
<td>237</td>
975+
<td><a href="examples/Program.html">Program</a></td>
976+
</tr>
973977
</table>
974978

975979

v2/book/pandocHTML.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ input-files:
250250
- examples/RapidEnum.html
251251
- examples/Csvcsharp.html
252252
- examples/validly.html
253+
- examples/Program.html
253254

254255
# or you may use input-file: with a single value
255256
# defaults:
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"generator":{
3+
"name":"Program",
4+
"nuget":[
5+
"https://www.nuget.org/packages/Microsoft.AspNetCore.OpenApi"
6+
],
7+
"link":"https://github.com/dotnet/aspnetcore/blob/70d851104f739fb906aabcd6a07c0935ce2549c9/src/Framework/AspNetCoreAnalyzers/src/SourceGenerators/PublicTopLevelProgramGenerator.cs#L11",
8+
"author":"Microsoft",
9+
"source":"https://github.com/dotnet/aspnetcore/"
10+
},
11+
"data":{
12+
"goodFor":["Generating Program.cs class for testing purposes"],
13+
"csprojDemo":"TestProgram.csproj",
14+
"csFiles":["Program.cs"],
15+
"excludeDirectoryGenerated":[
16+
"Microsoft.AspNetCore.Http.RequestDelegateGenerator",
17+
"Microsoft.AspNetCore.OpenApi.SourceGenerators",
18+
"System.Text.Json.SourceGeneration"
19+
],
20+
"includeAdditionalFiles":[""]
21+
},
22+
"links":{
23+
"blog":"",
24+
"video":""
25+
}
26+
}

0 commit comments

Comments
 (0)