Skip to content
Merged

first #467

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 - 264 Examples of Roslyn Source Code Generators / 16 created by Microsoft /
# RSCG - 265 Examples of Roslyn Source Code Generators / 16 created by Microsoft /

The RSCG_Examples repository is a comprehensive documentation system that automatically processes and showcases 264 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 265 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-04-06 => 06 April 2026
## Latest Update : 2026-04-07 => 07 April 2026
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Use non-future publication dates in README metadata.

Line 7 and Line 31 are set to 2026-04-07, but this PR was opened on April 4, 2026. This makes the README appear future-dated and can confuse chronology.

🛠️ Suggested date alignment
-## Latest Update : 2026-04-07 => 07 April 2026
+## Latest Update : 2026-04-04 => 04 April 2026
...
-Generated on : 2026-04-07 => 07 April 2026
+Generated on : 2026-04-04 => 04 April 2026

Also applies to: 31-31

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@README.md` at line 7, Update the README metadata dates that are set to the
future (instances of "2026-04-07") to the actual PR/open date (e.g.,
"2026-04-04") so the file isn't future-dated; locate the occurrences in the
README under the "## Latest Update" header and the other matching line (both
line 7 and line 31 in the current diff) and replace the date strings
consistently.


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 264 Roslyn Source Code Generators that I have tested you can see and download source code example.
Those are the 265 Roslyn Source Code Generators that I have tested you can see and download source code example.
( including 16 from Microsoft )
### 265. [lomapper](https://ignatandrei.github.io/RSCG_Examples/v2/docs/lomapper) , in the [Mapper](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#mapper) category

Generated on : 2026-04-07 => 07 April 2026

<details>
<summary>Expand</summary>



Author: Junaid Desai

LoMapper - Lightweight Object Mapper using compile-time source generation. Zero runtime reflection.

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


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

Source: [https://github.com/jdtoon/lomapper](https://github.com/jdtoon/lomapper)

</details>

### 264. [Najlot.Audit.SourceGenerator](https://ignatandrei.github.io/RSCG_Examples/v2/docs/Najlot.Audit.SourceGenerator) , in the [Audit](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#audit) category

Generated on : 2026-04-06 => 06 April 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-04-06 => 06 April 2026
## Latest Update : 2026-04-07 => 07 April 2026



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

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

,{
"file": "rscg_examples/loMapper/src/mapperDemo/PersonDTO.cs",
"description": "File PersonDTO.cs ",
"pattern": "this is the code"
}

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

,{
"file": "rscg_examples/loMapper/src/mapperDemo/Program.cs",
"description": "File Program.cs \r\n>> dotnet run --project rscg_examples/loMapper/src/mapperDemo/mapperDemo.csproj ",
"pattern": "this is the code"
}
Comment on lines +13 to +29
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Tour step patterns "this is the code" will never match actual source files.

The pattern property in CodeTour is used to locate a specific line in the file. The string "this is the code" doesn't exist in PersonDTO.cs, Person.cs, or Program.cs, so the tour will fail to highlight the intended location.

Use "line": 1 instead, or provide an actual pattern that exists in each file.

🔧 Proposed fix
         ,{
         "file": "rscg_examples/loMapper/src/mapperDemo/PersonDTO.cs",
         "description": "File PersonDTO.cs  ",
-        "pattern": "this is the code"
+        "line": 1
         }
     
         ,{
         "file": "rscg_examples/loMapper/src/mapperDemo/Person.cs",
         "description": "File Person.cs  ",
-        "pattern": "this is the code"
+        "line": 1
         }
     
         ,{
         "file": "rscg_examples/loMapper/src/mapperDemo/Program.cs",
         "description": "File Program.cs \r\n>> dotnet run --project rscg_examples/loMapper/src/mapperDemo/mapperDemo.csproj ",
-        "pattern": "this is the code"
+        "line": 1
         }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
,{
"file": "rscg_examples/loMapper/src/mapperDemo/PersonDTO.cs",
"description": "File PersonDTO.cs ",
"pattern": "this is the code"
}
,{
"file": "rscg_examples/loMapper/src/mapperDemo/Person.cs",
"description": "File Person.cs ",
"pattern": "this is the code"
}
,{
"file": "rscg_examples/loMapper/src/mapperDemo/Program.cs",
"description": "File Program.cs \r\n>> dotnet run --project rscg_examples/loMapper/src/mapperDemo/mapperDemo.csproj ",
"pattern": "this is the code"
}
,{
"file": "rscg_examples/loMapper/src/mapperDemo/PersonDTO.cs",
"description": "File PersonDTO.cs ",
"line": 1
}
,{
"file": "rscg_examples/loMapper/src/mapperDemo/Person.cs",
"description": "File Person.cs ",
"line": 1
}
,{
"file": "rscg_examples/loMapper/src/mapperDemo/Program.cs",
"description": "File Program.cs \r\n>> dotnet run --project rscg_examples/loMapper/src/mapperDemo/mapperDemo.csproj ",
"line": 1
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@v2/.tours/lomapper.tour` around lines 13 - 29, The tour steps use a
non-matching pattern ("this is the code") for the three entries referencing
PersonDTO.cs, Person.cs and Program.cs; update each step in the lomapper.tour to
either replace the "pattern": "this is the code" with a valid "line": 1 property
or set "pattern" to an actual string that exists in the target file (e.g., a
class or method name) so CodeTour can locate the intended lines for
PersonDTO.cs, Person.cs and Program.cs.



,{
"file": "rscg_examples/loMapper/src/mapperDemo/obj/GX/LoMapper.Generator/LoMapper.Generator.LoMapperGenerator/UserMapper.g.cs",
"description": "Generated File 6 from 6 : UserMapper.g.cs ",
"line": 1
}

,{
"file": "rscg_examples/loMapper/src/mapperDemo/obj/GX/LightweightObjectMapper/LightweightObjectMapper.LightweightObjectMapperSourceGenerator/PredefinedSpecialTypeMapping.Generated.cs",
"description": "Generated File 5 from 6 : PredefinedSpecialTypeMapping.Generated.cs ",
"line": 1
}

,{
"file": "rscg_examples/loMapper/src/mapperDemo/obj/GX/LightweightObjectMapper/LightweightObjectMapper.LightweightObjectMapperSourceGenerator/LOMMapExtensions_mapperDemo_Person.g.cs",
"description": "Generated File 4 from 6 : LOMMapExtensions_mapperDemo_Person.g.cs ",
"line": 1
}

,{
"file": "rscg_examples/loMapper/src/mapperDemo/obj/GX/LightweightObjectMapper/LightweightObjectMapper.LightweightObjectMapperSourceGenerator/LightweightObjectMapper.PreCodes.PredefinedSpecialTypeMapping.cs",
"description": "Generated File 3 from 6 : LightweightObjectMapper.PreCodes.PredefinedSpecialTypeMapping.cs ",
"line": 1
}

,{
"file": "rscg_examples/loMapper/src/mapperDemo/obj/GX/LightweightObjectMapper/LightweightObjectMapper.LightweightObjectMapperSourceGenerator/LightweightObjectMapper.PreCodes.LightweightObjectMapperPreCodes.cs",
"description": "Generated File 2 from 6 : LightweightObjectMapper.PreCodes.LightweightObjectMapperPreCodes.cs ",
"line": 1
}

,{
"file": "rscg_examples/loMapper/src/mapperDemo/obj/GX/LightweightObjectMapper/LightweightObjectMapper.LightweightObjectMapperSourceGenerator/Extensions.Generated.cs",
Comment on lines +8 to +63
Copy link

Copilot AI Apr 4, 2026

Choose a reason for hiding this comment

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

The CodeTour step file paths use rscg_examples/loMapper/... (capital M), but the example directory added in this PR is v2/rscg_examples/lomapper/ (lowercase). These references will not resolve on case-sensitive filesystems and will break the tour. Update the file paths to match the actual directory name (or rename the directory consistently).

Suggested change
"file": "rscg_examples/loMapper/src/mapperDemo/mapperDemo.csproj",
"description": "First, we add Nuget [lomapper](https://www.nuget.org/packages/lomapper/) in csproj ",
"pattern": "lomapper"
}
,{
"file": "rscg_examples/loMapper/src/mapperDemo/PersonDTO.cs",
"description": "File PersonDTO.cs ",
"pattern": "this is the code"
}
,{
"file": "rscg_examples/loMapper/src/mapperDemo/Person.cs",
"description": "File Person.cs ",
"pattern": "this is the code"
}
,{
"file": "rscg_examples/loMapper/src/mapperDemo/Program.cs",
"description": "File Program.cs \r\n>> dotnet run --project rscg_examples/loMapper/src/mapperDemo/mapperDemo.csproj ",
"pattern": "this is the code"
}
,{
"file": "rscg_examples/loMapper/src/mapperDemo/obj/GX/LoMapper.Generator/LoMapper.Generator.LoMapperGenerator/UserMapper.g.cs",
"description": "Generated File 6 from 6 : UserMapper.g.cs ",
"line": 1
}
,{
"file": "rscg_examples/loMapper/src/mapperDemo/obj/GX/LightweightObjectMapper/LightweightObjectMapper.LightweightObjectMapperSourceGenerator/PredefinedSpecialTypeMapping.Generated.cs",
"description": "Generated File 5 from 6 : PredefinedSpecialTypeMapping.Generated.cs ",
"line": 1
}
,{
"file": "rscg_examples/loMapper/src/mapperDemo/obj/GX/LightweightObjectMapper/LightweightObjectMapper.LightweightObjectMapperSourceGenerator/LOMMapExtensions_mapperDemo_Person.g.cs",
"description": "Generated File 4 from 6 : LOMMapExtensions_mapperDemo_Person.g.cs ",
"line": 1
}
,{
"file": "rscg_examples/loMapper/src/mapperDemo/obj/GX/LightweightObjectMapper/LightweightObjectMapper.LightweightObjectMapperSourceGenerator/LightweightObjectMapper.PreCodes.PredefinedSpecialTypeMapping.cs",
"description": "Generated File 3 from 6 : LightweightObjectMapper.PreCodes.PredefinedSpecialTypeMapping.cs ",
"line": 1
}
,{
"file": "rscg_examples/loMapper/src/mapperDemo/obj/GX/LightweightObjectMapper/LightweightObjectMapper.LightweightObjectMapperSourceGenerator/LightweightObjectMapper.PreCodes.LightweightObjectMapperPreCodes.cs",
"description": "Generated File 2 from 6 : LightweightObjectMapper.PreCodes.LightweightObjectMapperPreCodes.cs ",
"line": 1
}
,{
"file": "rscg_examples/loMapper/src/mapperDemo/obj/GX/LightweightObjectMapper/LightweightObjectMapper.LightweightObjectMapperSourceGenerator/Extensions.Generated.cs",
"file": "rscg_examples/lomapper/src/mapperDemo/mapperDemo.csproj",
"description": "First, we add Nuget [lomapper](https://www.nuget.org/packages/lomapper/) in csproj ",
"pattern": "lomapper"
}
,{
"file": "rscg_examples/lomapper/src/mapperDemo/PersonDTO.cs",
"description": "File PersonDTO.cs ",
"pattern": "this is the code"
}
,{
"file": "rscg_examples/lomapper/src/mapperDemo/Person.cs",
"description": "File Person.cs ",
"pattern": "this is the code"
}
,{
"file": "rscg_examples/lomapper/src/mapperDemo/Program.cs",
"description": "File Program.cs \r\n>> dotnet run --project rscg_examples/lomapper/src/mapperDemo/mapperDemo.csproj ",
"pattern": "this is the code"
}
,{
"file": "rscg_examples/lomapper/src/mapperDemo/obj/GX/LoMapper.Generator/LoMapper.Generator.LoMapperGenerator/UserMapper.g.cs",
"description": "Generated File 6 from 6 : UserMapper.g.cs ",
"line": 1
}
,{
"file": "rscg_examples/lomapper/src/mapperDemo/obj/GX/LightweightObjectMapper/LightweightObjectMapper.LightweightObjectMapperSourceGenerator/PredefinedSpecialTypeMapping.Generated.cs",
"description": "Generated File 5 from 6 : PredefinedSpecialTypeMapping.Generated.cs ",
"line": 1
}
,{
"file": "rscg_examples/lomapper/src/mapperDemo/obj/GX/LightweightObjectMapper/LightweightObjectMapper.LightweightObjectMapperSourceGenerator/LOMMapExtensions_mapperDemo_Person.g.cs",
"description": "Generated File 4 from 6 : LOMMapExtensions_mapperDemo_Person.g.cs ",
"line": 1
}
,{
"file": "rscg_examples/lomapper/src/mapperDemo/obj/GX/LightweightObjectMapper/LightweightObjectMapper.LightweightObjectMapperSourceGenerator/LightweightObjectMapper.PreCodes.PredefinedSpecialTypeMapping.cs",
"description": "Generated File 3 from 6 : LightweightObjectMapper.PreCodes.PredefinedSpecialTypeMapping.cs ",
"line": 1
}
,{
"file": "rscg_examples/lomapper/src/mapperDemo/obj/GX/LightweightObjectMapper/LightweightObjectMapper.LightweightObjectMapperSourceGenerator/LightweightObjectMapper.PreCodes.LightweightObjectMapperPreCodes.cs",
"description": "Generated File 2 from 6 : LightweightObjectMapper.PreCodes.LightweightObjectMapperPreCodes.cs ",
"line": 1
}
,{
"file": "rscg_examples/lomapper/src/mapperDemo/obj/GX/LightweightObjectMapper/LightweightObjectMapper.LightweightObjectMapperSourceGenerator/Extensions.Generated.cs",

Copilot uses AI. Check for mistakes.
"description": "Generated File 1 from 6 : Extensions.Generated.cs ",
"line": 1
}

],

"ref": "main"

}
2 changes: 1 addition & 1 deletion v2/Generator/MultiGeneratorV2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public string[] SourceNoRSCG()
{
var text=await File.ReadAllTextAsync(nameFile);
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/");
text = text.Replace("(docs/", $"({d.Generator!.Source}/docs/");
text = text.Replace("(img/", $"({d.Generator!.Source}/img/");
Expand Down
1 change: 1 addition & 0 deletions v2/Generator/all.csv
Original file line number Diff line number Diff line change
Expand Up @@ -263,3 +263,4 @@ Nr,Key,Source,Category
262,SvgIconGenerator, https://github.com/helluvamatt/SvgIconGenerator,FilesToCode
263,TaggedEnum, https://github.com/al0rid4l/SixTatami,Enum
264,Najlot.Audit.SourceGenerator, https://github.com/najlot/Audit,Audit
265,loMapper, https://github.com/jdtoon/lomapper,Mapper
Copy link

Copilot AI Apr 4, 2026

Choose a reason for hiding this comment

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

The new CSV row uses the key loMapper, but the newly added example folder is v2/rscg_examples/lomapper/ and the site/docs mostly use lomapper. This key is used as the generator identifier in the pipeline; mismatched casing will cause lookups/path resolution issues on case-sensitive systems. Standardize the key casing across all.csv, GeneratorDataRec.json, and the example folder name.

Suggested change
265,loMapper, https://github.com/jdtoon/lomapper,Mapper
265,lomapper, https://github.com/jdtoon/lomapper,Mapper

Copilot uses AI. Check for mistakes.
8 changes: 7 additions & 1 deletion v2/RSCGExamplesData/GeneratorDataRec.json
Original file line number Diff line number Diff line change
Expand Up @@ -1600,5 +1600,11 @@
"Category": 47,
"dtStart": "2026-04-06T00:00:00",
"show": true
}
},
{
"ID":"lomapper",
"Category": 6,
"dtStart": "2026-04-07T00:00:00",
"show": true
}
]
90 changes: 90 additions & 0 deletions v2/book/examples/lomapper.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@

<h1>RSCG nr 265 : lomapper</h1>

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

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

<p>Author :Junaid Desai</p>

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

<h2>About</h2>

Generate mapping code at compile time using source generators.

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

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

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

<br />
The file <i>generated</i> is Extensions.Generated.cs
<br />
<img src="images/lomapper/generated/Extensions.Generated.cs.png" width="580" height="580" />

<br />
The file <i>generated</i> is LightweightObjectMapper.PreCodes.LightweightObjectMapperPreCodes.cs
<br />
<img src="images/lomapper/generated/LightweightObjectMapper.PreCodes.LightweightObjectMapperPreCodes.cs.png" width="580" height="580" />

<br />
The file <i>generated</i> is LightweightObjectMapper.PreCodes.PredefinedSpecialTypeMapping.cs
<br />
<img src="images/lomapper/generated/LightweightObjectMapper.PreCodes.PredefinedSpecialTypeMapping.cs.png" width="580" height="580" />

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

<br />
The file <i>generated</i> is PredefinedSpecialTypeMapping.Generated.cs
<br />
<img src="images/lomapper/generated/PredefinedSpecialTypeMapping.Generated.cs.png" width="580" height="580" />

<br />
The file <i>generated</i> is UserMapper.g.cs
<br />
<img src="images/lomapper/generated/UserMapper.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/lomapper'>
https://ignatandrei.github.io/RSCG_Examples/v2/docs/lomapper
</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 264 RSCG with examples =>
This is the list of 265 RSCG with examples =>
</h1>

<table >
Expand Down Expand Up @@ -1082,6 +1082,10 @@ <h1>
<td>264</td>
<td><a href="examples/Najlot.Audit.SourceGenerator.html">Najlot.Audit.SourceGenerator</a></td>
</tr>
<tr>
<td>265</td>
<td><a href="examples/lomapper.html">lomapper</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 @@ -278,6 +278,7 @@ input-files:
- examples/SvgIconGenerator.html
- examples/TaggedEnum.html
- examples/Najlot.Audit.SourceGenerator.html
- examples/lomapper.html

# or you may use input-file: with a single value
# defaults:
Expand Down
22 changes: 22 additions & 0 deletions v2/rscg_examples/lomapper/description.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"generator":{
"name":"lomapper",
"nuget":[
"https://www.nuget.org/packages/lomapper/"
],
"link":"https://github.com/jdtoon/lomapper",
"author":"Junaid Desai",
"source":"https://github.com/jdtoon/lomapper"
},
"data":{
"goodFor":["Generate mapping code at compile time using source generators."],
"csprojDemo":"mapperDemo.csproj",
"csFiles":["Program.cs","Person.cs","PersonDTO.cs"],
"excludeDirectoryGenerated":[""],
"includeAdditionalFiles":[""]
},
"links":{
"blog":"",
"video":""
}
}
1 change: 1 addition & 0 deletions v2/rscg_examples/lomapper/nuget.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
LoMapper - Lightweight Object Mapper using compile-time source generation. Zero runtime reflection.
Loading
Loading