You have 27 examples with my own source codes ( see below).
Also, there are 53 more examples waiting to be discovered/analyzed by you .
| Nr. | Name | Summary |
| 1 |
See in action: ThisAssembly
Other links: |
The ThisAssembly.Info allows you access to the Assembly Information as constants, instead of going to reflection each time. I found useful to see the assembly version right away in any project that I have. |
| 2 |
See in action: Enum
Other links: |
This will generate code to fast parsing a int or a string to an enum |
| 3 |
See in action: JsonByExampleGenerator
Other links: |
This will generate C# classes from json files. |
| 4 |
See in action: CopyConstructor + Deconstructor
Other links: |
This will generate code for a POCO to generate copy constructor and deconstructor |
| 5 |
See in action: GeneratedMapper
Other links: |
AutoMapping from a POCO to a DTO. Lots of customizations |
| 6 |
See in action: Skinny Controllers
Other links: |
This will generate code for WebAPI for each method of a field in the controller |
| 7 |
See in action: data-builder-generator
Other links: |
Implements the Builder Design pattern for any class. Useful , at least, for test projects |
| 8 |
See in action: Metadata from object
Other links: |
This will generate code to retrieve the values of properties directly, not by reflection |
| 9 |
See in action: MockSourceGenerator
Other links: |
This will generate Mock classes directly for any interface - with your implementation. |
| 10 |
See in action: Method decorator
Other links: |
This will generate code to decorate methods with anything you want ( stopwatch, logging , authorization...) |
| 11 |
See in action: PartiallyApplied
Other links: |
This will generate curry for your functions |
| 12 |
See in action: IFormattable
Other links: |
This will generate code to add IFormattable to any class, based on the properties of the class |
| 13 |
See in action: AutoInterface
Other links: |
Implement the Design Pattern Decorator. Based on template - you can modify the source code generated |
| 14 |
See in action: Property Expression Generator
Other links: |
This will generate code to add function to be used with Entity Framework to search for any property of a class |
| 15 |
See in action: Transplator
Other links: |
The Transplator is a small fast rendering engine to allow you to make rendering from any class instance. |
| 16 |
See in action: RSCG_AMS
Other links: |
The AMS will add in the CI the version and creator to your project.See https://netcoreblockly.herokuapp.com/ams for an example |
| 17 |
See in action: HttpClientGenerator
Other links: |
HttpClientGenerator is a tool that uses Roslyn code generator feature to write boilerplate HttpClient code for you. |
| 18 |
See in action: DatabaseToWebAPI
Other links: |
This will generate code (WebAPI/Swagger) for any table/view from SqlServer. You can see the table via Angular |
| 19 |
See in action: SourceInject
Other links: |
Auto register services in startup |
| 20 |
See in action: Static To Interface
Other links: |
This will generate code for any static properties of a class to generate interface, record and a class with real behaviour |
| 21 |
See in action: BaseTypes
Other links: |
Generated tiny types from any value type |
| 22 |
See in action: AppSettingsEditor
Other links: |
This will generate classes code from appsettings . Additionally , it generates API controller for editing and an UI interface |
| 23 |
See in action: ApparatusAOT
Other links: |
This will generate code for investigating at runtime the properties of an object |
| 24 |
See in action: RSCG_TimeBombComment
Other links: |
This will generate an error from the comment after a certain date |
| 25 |
See in action: StructRecordsGenerator
Other links: |
This will generate code .ToString. Usefull for debugging |
| 26 |
See in action: AOPMarkerCI
Other links: |
This will tracing methods marked with AOPMarkerMethod in CI builds. Does not affect the code run by the programmer. |
| 27 |
See in action: BoilerplateFree
Other links: |
This will generate interface from a class |
There are more awesome RSCG that you could use - here is a list of 53 RSCG that you may want to look at:
https://github.com/dotnet/roslyn/blob/master/docs/features/source-generators.md
https://github.com/dotnet/roslyn/blob/master/docs/features/source-generators.cookbook.md
https://github.com/dotnet/roslyn-sdk/tree/master/samples/CSharp/SourceGenerators
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
<CompilerGeneratedFilesOutputPath>$(BaseIntermediateOutputPath)Generated</CompilerGeneratedFilesOutputPath>In the RSCG project
<PropertyGroup>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<IsRoslynComponent>true</IsRoslynComponent>
</PropertyGroup>
```xml
In the project
```xml
<ItemGroup>
<ProjectReference Include="Path_To_The.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
</ItemGroup>