Skip to content

Commit

Permalink
Merge pull request #348 from ignatandrei/NullObject
Browse files Browse the repository at this point in the history
Null object
  • Loading branch information
ignatandrei authored Jan 21, 2025
2 parents 33786a3 + 6ec9c7a commit 9b940b9
Show file tree
Hide file tree
Showing 76 changed files with 1,313 additions and 1,016 deletions.
28 changes: 25 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# RSCG - 181 Examples of Roslyn Source Code Generators / 14 created by Microsoft /
# RSCG - 182 Examples of Roslyn Source Code Generators / 14 created by Microsoft /

## Latest Update : 2025-01-17 => 17 January 2025
## Latest Update : 2025-01-18 => 18 January 2025

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 @@ -20,8 +20,30 @@ If you want to be notified each time I add a new RSCG example , please click htt

## Content

Those are the 181 Roslyn Source Code Generators that I have tested you can see and download source code example.
Those are the 182 Roslyn Source Code Generators that I have tested you can see and download source code example.
( including 14 from Microsoft )
### 182. [rscg_Interface_to_null_object](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg_Interface_to_null_object) , in the [Interface](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#interface) category

Generated on : 2025-01-18 => 18 January 2025

<details>
<summary>Expand</summary>



Author: Andrei Ignat

Interface to null object - common

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


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

Source: [https://github.com/ignatandrei/rscg_Interface_to_null_object/](https://github.com/ignatandrei/rscg_Interface_to_null_object/)

</details>

### 181. [Larcanum.GitInfo](https://ignatandrei.github.io/RSCG_Examples/v2/docs/Larcanum.GitInfo) , in the [EnhancementProject](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#enhancementproject) category

Generated on : 2025-01-17 => 17 January 2025
Expand Down
2 changes: 2 additions & 0 deletions v2/Generator/all.csv
Original file line number Diff line number Diff line change
Expand Up @@ -179,3 +179,5 @@ Nr,Key,Source,Category
178,Valuify, https://github.com/MooVC/valuify,Equals
179,ConstructorGenerator, https://github.com/Swarley97/ConstructorGenerator,Constructor
180,Pure.DI, https://github.com/DevTeam/Pure.DI,DependencyInjection
181,Larcanum.GitInfo, https://github.com/lord-executor/Larcanum.GitInfo,EnhancementProject
182,rscg_Interface_to_null_object, https://github.com/ignatandrei/rscg_Interface_to_null_object/,Interface
7 changes: 7 additions & 0 deletions v2/RSCGExamplesData/GeneratorDataRec.json
Original file line number Diff line number Diff line change
Expand Up @@ -1090,5 +1090,12 @@
"Category": 1,
"dtStart": "2025-01-17T00:00:00",
"show": true
},
{
"ID":"rscg_Interface_to_null_object",
"Category": 20,
"dtStart": "2025-01-18T00:00:00",
"show": true

}
]
5 changes: 0 additions & 5 deletions v2/book/examples/Dusharp.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,6 @@ <h3>And here are the <i>generated</i> files</h3>
<br />
<img src="images/Dusharp/generated/UnionTypesDemo.ResultSave.Dusharp.g.cs.png" width="580" height="580" />

<br />
The file <i>generated</i> is UnionTypesDemo.ResultSave.union.g.cs
<br />
<img src="images/Dusharp/generated/UnionTypesDemo.ResultSave.union.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/Dusharp'>
Expand Down
5 changes: 5 additions & 0 deletions v2/book/examples/Equatable.Generator.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ <h3>And here are the <i>generated</i> files</h3>
<br />
<img src="images/Equatable.Generator/generated/GeneratorEqualsDemo.Person.Equatable.g.cs.png" width="580" height="580" />

<br />
The file <i>generated</i> is GeneratorEqualsDemo.Person.Generator.Equals.g.cs
<br />
<img src="images/Equatable.Generator/generated/GeneratorEqualsDemo.Person.Generator.Equals.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/Equatable.Generator'>
Expand Down
50 changes: 0 additions & 50 deletions v2/book/examples/InterceptorTemplate.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,56 +55,6 @@ <h3>This was for me the <b>starting</b> code</h3>
<hr />
<h3>And here are the <i>generated</i> files</h3>

<br />
The file <i>generated</i> is RSCG_DemoObjects.IPersonLoader_InsertPerson_10.cs
<br />
<img src="images/InterceptorTemplate/generated/RSCG_DemoObjects.IPersonLoader_InsertPerson_10.cs.png" width="580" height="580" />

<br />
The file <i>generated</i> is RSCG_DemoObjects.PersonLoader_Connect_9.cs
<br />
<img src="images/InterceptorTemplate/generated/RSCG_DemoObjects.PersonLoader_Connect_9.cs.png" width="580" height="580" />

<br />
The file <i>generated</i> is RSCG_DemoObjects.PersonLoader_SavePerson_8.cs
<br />
<img src="images/InterceptorTemplate/generated/RSCG_DemoObjects.PersonLoader_SavePerson_8.cs.png" width="580" height="580" />

<br />
The file <i>generated</i> is RSCG_DemoObjects.Person_FullName_1.cs
<br />
<img src="images/InterceptorTemplate/generated/RSCG_DemoObjects.Person_FullName_1.cs.png" width="580" height="580" />

<br />
The file <i>generated</i> is RSCG_DemoObjects.Person_FullName_3.cs
<br />
<img src="images/InterceptorTemplate/generated/RSCG_DemoObjects.Person_FullName_3.cs.png" width="580" height="580" />

<br />
The file <i>generated</i> is RSCG_DemoObjects.Person_PersonsLoaded_4.cs
<br />
<img src="images/InterceptorTemplate/generated/RSCG_DemoObjects.Person_PersonsLoaded_4.cs.png" width="580" height="580" />

<br />
The file <i>generated</i> is RSCG_DemoObjects.Person_PersonsLoaded_5.cs
<br />
<img src="images/InterceptorTemplate/generated/RSCG_DemoObjects.Person_PersonsLoaded_5.cs.png" width="580" height="580" />

<br />
The file <i>generated</i> is RSCG_DemoObjects.Person_ShowRandomPersonNumber_7.cs
<br />
<img src="images/InterceptorTemplate/generated/RSCG_DemoObjects.Person_ShowRandomPersonNumber_7.cs.png" width="580" height="580" />

<br />
The file <i>generated</i> is RSCG_DemoObjects.Person_TestFullNameWithArguments_6.cs
<br />
<img src="images/InterceptorTemplate/generated/RSCG_DemoObjects.Person_TestFullNameWithArguments_6.cs.png" width="580" height="580" />

<br />
The file <i>generated</i> is RSCG_DemoObjects.Person_Test_2.cs
<br />
<img src="images/InterceptorTemplate/generated/RSCG_DemoObjects.Person_Test_2.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/InterceptorTemplate'>
Expand Down
2 changes: 1 addition & 1 deletion v2/book/examples/Larcanum.GitInfo.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ <h2>Info</h2>

<h2>About</h2>


Generates GitInfo data from the current environment.

<h2>
How to use
Expand Down
5 changes: 0 additions & 5 deletions v2/book/examples/PlantUmlClassDiagramGenerator.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,6 @@ <h3>And here are the <i>generated</i> files</h3>
<br />
<img src="images/PlantUmlClassDiagramGenerator/generated/Attributes.cs.png" width="580" height="580" />

<br />
The file <i>generated</i> is Person.puml
<br />
<img src="images/PlantUmlClassDiagramGenerator/generated/Person.puml.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/PlantUmlClassDiagramGenerator'>
Expand Down
75 changes: 75 additions & 0 deletions v2/book/examples/rscg_Interface_to_null_object.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@

<h1>RSCG nr 182 : rscg_Interface_to_null_object</h1>

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

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

<p>Author :Andrei Ignat</p>

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

<h2>About</h2>

Generate null objects for interfaces

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

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

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

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

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

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

<table >
Expand Down Expand Up @@ -750,6 +750,10 @@ <h1>
<td>181</td>
<td><a href="examples/Larcanum.GitInfo.html">Larcanum.GitInfo</a></td>
</tr>
<tr>
<td>182</td>
<td><a href="examples/rscg_Interface_to_null_object.html">rscg_Interface_to_null_object</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 @@ -195,6 +195,7 @@ input-files:
- examples/ConstructorGenerator.html
- examples/Pure.DI.html
- examples/Larcanum.GitInfo.html
- examples/rscg_Interface_to_null_object.html

# or you may use input-file: with a single value
# defaults:
Expand Down
14 changes: 4 additions & 10 deletions v2/rscg_examples/Dusharp/src/.tours/Dusharp.tour
Original file line number Diff line number Diff line change
Expand Up @@ -29,33 +29,27 @@
}


,{
"file": "UnionTypesDemo/obj/GX/Sera.TaggedUnion.Analyzers/Sera.TaggedUnion.Analyzers.Generators.UnionGenerator/UnionTypesDemo.ResultSave.union.g.cs",
"description": "Generated File 5 from 5 : UnionTypesDemo.ResultSave.union.g.cs ",
"line": 1
}

,{
"file": "UnionTypesDemo/obj/GX/Dusharp/Dusharp.UnionSourceGenerator/UnionTypesDemo.ResultSave.Dusharp.g.cs",
"description": "Generated File 4 from 5 : UnionTypesDemo.ResultSave.Dusharp.g.cs ",
"description": "Generated File 4 from 4 : UnionTypesDemo.ResultSave.Dusharp.g.cs ",
"line": 1
}

,{
"file": "UnionTypesDemo/obj/GX/Dusharp/Dusharp.UnionSourceGenerator/Dusharp.EmbeddedCode.UnionCaseAttribute.cs",
"description": "Generated File 3 from 5 : Dusharp.EmbeddedCode.UnionCaseAttribute.cs ",
"description": "Generated File 3 from 4 : Dusharp.EmbeddedCode.UnionCaseAttribute.cs ",
"line": 1
}

,{
"file": "UnionTypesDemo/obj/GX/Dusharp/Dusharp.UnionSourceGenerator/Dusharp.EmbeddedCode.UnionAttribute.cs",
"description": "Generated File 2 from 5 : Dusharp.EmbeddedCode.UnionAttribute.cs ",
"description": "Generated File 2 from 4 : Dusharp.EmbeddedCode.UnionAttribute.cs ",
"line": 1
}

,{
"file": "UnionTypesDemo/obj/GX/Dusharp/Dusharp.UnionSourceGenerator/Dusharp.EmbeddedCode.ExceptionUtils.cs",
"description": "Generated File 1 from 5 : Dusharp.EmbeddedCode.ExceptionUtils.cs ",
"description": "Generated File 1 from 4 : Dusharp.EmbeddedCode.ExceptionUtils.cs ",
"line": 1
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,15 @@
}


,{
"file": "GeneratorEqualsDemo/obj/GX/Generator.Equals/Generator.Equals.EqualsGenerator/GeneratorEqualsDemo.Person.Generator.Equals.g.cs",
"description": "Generated File 2 from 2 : GeneratorEqualsDemo.Person.Generator.Equals.g.cs ",
"line": 1
}

,{
"file": "GeneratorEqualsDemo/obj/GX/Equatable.SourceGenerator/Equatable.SourceGenerator.EquatableGenerator/GeneratorEqualsDemo.Person.Equatable.g.cs",
"description": "Generated File 1 from 1 : GeneratorEqualsDemo.Person.Equatable.g.cs ",
"description": "Generated File 1 from 2 : GeneratorEqualsDemo.Person.Equatable.g.cs ",
"line": 1
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,66 +41,6 @@
}


,{
"file": "RSCG_InterceptorTemplateConsole/obj/GX/RSCG_InterceptorTemplate/RSCG_InterceptorTemplate.MethodIntercept/RSCG_DemoObjects.Person_Test_2.cs",
"description": "Generated File 10 from 10 : RSCG_DemoObjects.Person_Test_2.cs ",
"line": 1
}

,{
"file": "RSCG_InterceptorTemplateConsole/obj/GX/RSCG_InterceptorTemplate/RSCG_InterceptorTemplate.MethodIntercept/RSCG_DemoObjects.Person_TestFullNameWithArguments_6.cs",
"description": "Generated File 9 from 10 : RSCG_DemoObjects.Person_TestFullNameWithArguments_6.cs ",
"line": 1
}

,{
"file": "RSCG_InterceptorTemplateConsole/obj/GX/RSCG_InterceptorTemplate/RSCG_InterceptorTemplate.MethodIntercept/RSCG_DemoObjects.Person_ShowRandomPersonNumber_7.cs",
"description": "Generated File 8 from 10 : RSCG_DemoObjects.Person_ShowRandomPersonNumber_7.cs ",
"line": 1
}

,{
"file": "RSCG_InterceptorTemplateConsole/obj/GX/RSCG_InterceptorTemplate/RSCG_InterceptorTemplate.MethodIntercept/RSCG_DemoObjects.Person_PersonsLoaded_5.cs",
"description": "Generated File 7 from 10 : RSCG_DemoObjects.Person_PersonsLoaded_5.cs ",
"line": 1
}

,{
"file": "RSCG_InterceptorTemplateConsole/obj/GX/RSCG_InterceptorTemplate/RSCG_InterceptorTemplate.MethodIntercept/RSCG_DemoObjects.Person_PersonsLoaded_4.cs",
"description": "Generated File 6 from 10 : RSCG_DemoObjects.Person_PersonsLoaded_4.cs ",
"line": 1
}

,{
"file": "RSCG_InterceptorTemplateConsole/obj/GX/RSCG_InterceptorTemplate/RSCG_InterceptorTemplate.MethodIntercept/RSCG_DemoObjects.Person_FullName_3.cs",
"description": "Generated File 5 from 10 : RSCG_DemoObjects.Person_FullName_3.cs ",
"line": 1
}

,{
"file": "RSCG_InterceptorTemplateConsole/obj/GX/RSCG_InterceptorTemplate/RSCG_InterceptorTemplate.MethodIntercept/RSCG_DemoObjects.Person_FullName_1.cs",
"description": "Generated File 4 from 10 : RSCG_DemoObjects.Person_FullName_1.cs ",
"line": 1
}

,{
"file": "RSCG_InterceptorTemplateConsole/obj/GX/RSCG_InterceptorTemplate/RSCG_InterceptorTemplate.MethodIntercept/RSCG_DemoObjects.PersonLoader_SavePerson_8.cs",
"description": "Generated File 3 from 10 : RSCG_DemoObjects.PersonLoader_SavePerson_8.cs ",
"line": 1
}

,{
"file": "RSCG_InterceptorTemplateConsole/obj/GX/RSCG_InterceptorTemplate/RSCG_InterceptorTemplate.MethodIntercept/RSCG_DemoObjects.PersonLoader_Connect_9.cs",
"description": "Generated File 2 from 10 : RSCG_DemoObjects.PersonLoader_Connect_9.cs ",
"line": 1
}

,{
"file": "RSCG_InterceptorTemplateConsole/obj/GX/RSCG_InterceptorTemplate/RSCG_InterceptorTemplate.MethodIntercept/RSCG_DemoObjects.IPersonLoader_InsertPerson_10.cs",
"description": "Generated File 1 from 10 : RSCG_DemoObjects.IPersonLoader_InsertPerson_10.cs ",
"line": 1
}

],

"ref": "main"
Expand Down
Loading

0 comments on commit 9b940b9

Please sign in to comment.