diff --git a/README.md b/README.md index 338760315..be579aa21 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# RSCG - 225 Examples of Roslyn Source Code Generators / 14 created by Microsoft / +# RSCG - 226 Examples of Roslyn Source Code Generators / 14 created by Microsoft / -## Latest Update : 2025-08-13 => 13 August 2025 +## Latest Update : 2025-08-14 => 14 August 2025 If you want to see examples with code, please click ***[List V2](https://ignatandrei.github.io/RSCG_Examples/v2/docs/List-of-RSCG)*** @@ -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 225 Roslyn Source Code Generators that I have tested you can see and download source code example. +Those are the 226 Roslyn Source Code Generators that I have tested you can see and download source code example. ( including 14 from Microsoft ) +### 226. [requiredenum](https://ignatandrei.github.io/RSCG_Examples/v2/docs/requiredenum) , in the [Enum](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#enum) category + +Generated on : 2025-08-14 => 14 August 2025 + +
+ Expand + + + +Author: Yaroslav + +RequiredEnum is an open-source analyzer that helps handle all enum values for switch. + +Nuget: [https://www.nuget.org/packages/requiredenum/](https://www.nuget.org/packages/requiredenum/) + + +Link: [https://ignatandrei.github.io/RSCG_Examples/v2/docs/requiredenum](https://ignatandrei.github.io/RSCG_Examples/v2/docs/requiredenum) + +Source: [https://github.com/emptycoder/RequiredEnum](https://github.com/emptycoder/RequiredEnum) + +
+ ### 225. [Schema](https://ignatandrei.github.io/RSCG_Examples/v2/docs/Schema) , in the [Serializer](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#serializer) category Generated on : 2025-08-13 => 13 August 2025 @@ -5142,7 +5164,7 @@ Please help with those by providing a simple example : 1) [AdaskoTheBeAsT.Identity.Dapper]( https://github.com/AdaskoTheBeAsT/AdaskoTheBeAsT.Identity.Dapper) , https://github.com/AdaskoTheBeAsT/AdaskoTheBeAsT.Identity.Dapper -Why I have not tested : later +Why I have not tested : too complicated https://github.com/ignatandrei/RSCG_Examples/issues/new?title=AdaskoTheBeAsT.Identity.Dapper&body=https://github.com/AdaskoTheBeAsT/AdaskoTheBeAsT.Identity.Dapper @@ -5156,7 +5178,7 @@ https://github.com/ignatandrei/RSCG_Examples/issues/new?title=ApiClientGenerator 3) [AttributeFactoryGenerator]( https://github.com/PaulBraetz/AttributeFactoryGenerator) , https://github.com/PaulBraetz/AttributeFactoryGenerator -Why I have not tested : later +Why I have not tested : too complicated https://github.com/ignatandrei/RSCG_Examples/issues/new?title=AttributeFactoryGenerator&body=https://github.com/PaulBraetz/AttributeFactoryGenerator @@ -5233,7 +5255,7 @@ https://github.com/ignatandrei/RSCG_Examples/issues/new?title=FastEndpoints&body 14) [FluentAssertions.Eventual]( https://github.com/mazharenko/FluentAssertions.Eventual) , https://github.com/mazharenko/FluentAssertions.Eventual -Why I have not tested : later +Why I have not tested : atchived https://github.com/ignatandrei/RSCG_Examples/issues/new?title=FluentAssertions.Eventual&body=https://github.com/mazharenko/FluentAssertions.Eventual @@ -5247,7 +5269,7 @@ https://github.com/ignatandrei/RSCG_Examples/issues/new?title=GRPC-Mock-Server&b 16) [H.NSwag.Generator]( https://github.com/HavenDV/H.NSwag.Generator) , https://github.com/HavenDV/H.NSwag.Generator -Why I have not tested : later +Why I have not tested : do not understand https://github.com/ignatandrei/RSCG_Examples/issues/new?title=H.NSwag.Generator&body=https://github.com/HavenDV/H.NSwag.Generator @@ -5259,357 +5281,329 @@ Why I have not tested : issue opened https://github.com/ignatandrei/RSCG_Examples/issues/new?title=Hexa.Protobuf&body=https://github.com/HexaEngine/Hexa.Protobuf -18) [Hsu.Sg.Proxy]( https://github.com/hsu-net/source-generators/) , https://github.com/hsu-net/source-generators/ - -Why I have not tested : later - -https://github.com/ignatandrei/RSCG_Examples/issues/new?title=Hsu.Sg.Proxy&body=https://github.com/hsu-net/source-generators/ - - -19) [https://github.com/Agentew04/CliToolkit]( https://github.com/Agentew04/CliToolkit) , https://github.com/Agentew04/CliToolkit +18) [https://github.com/Agentew04/CliToolkit]( https://github.com/Agentew04/CliToolkit) , https://github.com/Agentew04/CliToolkit Why I have not tested : issue opened https://github.com/ignatandrei/RSCG_Examples/issues/new?title=https://github.com/Agentew04/CliToolkit&body=https://github.com/Agentew04/CliToolkit -20) [https://github.com/AlexNav73/CoreCraft]( https://github.com/AlexNav73/CoreCraft) , https://github.com/AlexNav73/CoreCraft +19) [https://github.com/AlexNav73/CoreCraft]( https://github.com/AlexNav73/CoreCraft) , https://github.com/AlexNav73/CoreCraft -Why I have not tested : later +Why I have not tested : too complicated https://github.com/ignatandrei/RSCG_Examples/issues/new?title=https://github.com/AlexNav73/CoreCraft&body=https://github.com/AlexNav73/CoreCraft -21) [https://github.com/Atoen/TextLocalizer]( https://github.com/Atoen/TextLocalizer) , https://github.com/Atoen/TextLocalizer +20) [https://github.com/Atoen/TextLocalizer]( https://github.com/Atoen/TextLocalizer) , https://github.com/Atoen/TextLocalizer -Why I have not tested : later +Why I have not tested : too complicated https://github.com/ignatandrei/RSCG_Examples/issues/new?title=https://github.com/Atoen/TextLocalizer&body=https://github.com/Atoen/TextLocalizer -22) [https://github.com/bjornhellander/TestInheritanceGenerator]( https://github.com/bjornhellander/TestInheritanceGenerator) , https://github.com/bjornhellander/TestInheritanceGenerator +21) [https://github.com/bjornhellander/TestInheritanceGenerator]( https://github.com/bjornhellander/TestInheritanceGenerator) , https://github.com/bjornhellander/TestInheritanceGenerator -Why I have not tested : later +Why I have not tested : too complicated https://github.com/ignatandrei/RSCG_Examples/issues/new?title=https://github.com/bjornhellander/TestInheritanceGenerator&body=https://github.com/bjornhellander/TestInheritanceGenerator -23) [https://github.com/borisdj/CsCodeGenerator]( https://github.com/borisdj/CsCodeGenerator) , https://github.com/borisdj/CsCodeGenerator +22) [https://github.com/borisdj/CsCodeGenerator]( https://github.com/borisdj/CsCodeGenerator) , https://github.com/borisdj/CsCodeGenerator Why I have not tested : later https://github.com/ignatandrei/RSCG_Examples/issues/new?title=https://github.com/borisdj/CsCodeGenerator&body=https://github.com/borisdj/CsCodeGenerator -24) [https://github.com/buchmiet/FastFsm]( https://github.com/buchmiet/FastFsm) , https://github.com/buchmiet/FastFsm +23) [https://github.com/buchmiet/FastFsm]( https://github.com/buchmiet/FastFsm) , https://github.com/buchmiet/FastFsm Why I have not tested : later https://github.com/ignatandrei/RSCG_Examples/issues/new?title=https://github.com/buchmiet/FastFsm&body=https://github.com/buchmiet/FastFsm -25) [https://github.com/chickensoft-games/LogicBlocks]( https://github.com/chickensoft-games/LogicBlocks) , https://github.com/chickensoft-games/LogicBlocks +24) [https://github.com/chickensoft-games/LogicBlocks]( https://github.com/chickensoft-games/LogicBlocks) , https://github.com/chickensoft-games/LogicBlocks Why I have not tested : later https://github.com/ignatandrei/RSCG_Examples/issues/new?title=https://github.com/chickensoft-games/LogicBlocks&body=https://github.com/chickensoft-games/LogicBlocks -26) [https://github.com/dgmjr-io/InterfaceGenerator]( https://github.com/dgmjr-io/InterfaceGenerator) , https://github.com/dgmjr-io/InterfaceGenerator +25) [https://github.com/dgmjr-io/InterfaceGenerator]( https://github.com/dgmjr-io/InterfaceGenerator) , https://github.com/dgmjr-io/InterfaceGenerator Why I have not tested : issue opened https://github.com/ignatandrei/RSCG_Examples/issues/new?title=https://github.com/dgmjr-io/InterfaceGenerator&body=https://github.com/dgmjr-io/InterfaceGenerator -27) [https://github.com/eddievelasquez/IntercodeToolbox]( https://github.com/eddievelasquez/IntercodeToolbox) , https://github.com/eddievelasquez/IntercodeToolbox +26) [https://github.com/eddievelasquez/IntercodeToolbox]( https://github.com/eddievelasquez/IntercodeToolbox) , https://github.com/eddievelasquez/IntercodeToolbox -Why I have not tested : later +Why I have not tested : too complicated https://github.com/ignatandrei/RSCG_Examples/issues/new?title=https://github.com/eddievelasquez/IntercodeToolbox&body=https://github.com/eddievelasquez/IntercodeToolbox -28) [https://github.com/GaoNian-NET/MapperToolkit]( https://github.com/GaoNian-NET/MapperToolkit) , https://github.com/GaoNian-NET/MapperToolkit +27) [https://github.com/GaoNian-NET/MapperToolkit]( https://github.com/GaoNian-NET/MapperToolkit) , https://github.com/GaoNian-NET/MapperToolkit Why I have not tested : issue opened https://github.com/ignatandrei/RSCG_Examples/issues/new?title=https://github.com/GaoNian-NET/MapperToolkit&body=https://github.com/GaoNian-NET/MapperToolkit -29) [https://github.com/inputfalken/Dynatello]( https://github.com/inputfalken/Dynatello) , https://github.com/inputfalken/Dynatello +28) [https://github.com/inputfalken/Dynatello]( https://github.com/inputfalken/Dynatello) , https://github.com/inputfalken/Dynatello -Why I have not tested : later +Why I have not tested : too complicated https://github.com/ignatandrei/RSCG_Examples/issues/new?title=https://github.com/inputfalken/Dynatello&body=https://github.com/inputfalken/Dynatello -30) [https://github.com/ionite34/MinimalApiMapper]( https://github.com/ionite34/MinimalApiMapper) , https://github.com/ionite34/MinimalApiMapper +29) [https://github.com/ionite34/MinimalApiMapper]( https://github.com/ionite34/MinimalApiMapper) , https://github.com/ionite34/MinimalApiMapper Why I have not tested : later https://github.com/ignatandrei/RSCG_Examples/issues/new?title=https://github.com/ionite34/MinimalApiMapper&body=https://github.com/ionite34/MinimalApiMapper -31) [https://github.com/JasonBock/CslaGeneratorSerialization]( https://github.com/JasonBock/CslaGeneratorSerialization) , https://github.com/JasonBock/CslaGeneratorSerialization +30) [https://github.com/JasonBock/CslaGeneratorSerialization]( https://github.com/JasonBock/CslaGeneratorSerialization) , https://github.com/JasonBock/CslaGeneratorSerialization -Why I have not tested : later +Why I have not tested : too complicated https://github.com/ignatandrei/RSCG_Examples/issues/new?title=https://github.com/JasonBock/CslaGeneratorSerialization&body=https://github.com/JasonBock/CslaGeneratorSerialization -32) [https://github.com/MarkFl12/BlazorLinks]( https://github.com/MarkFl12/BlazorLinks) , https://github.com/MarkFl12/BlazorLinks - -Why I have not tested : later - -https://github.com/ignatandrei/RSCG_Examples/issues/new?title=https://github.com/MarkFl12/BlazorLinks&body=https://github.com/MarkFl12/BlazorLinks - - -33) [https://github.com/OrgEleCho/EleCho.Internationalization]( https://github.com/OrgEleCho/EleCho.Internationalization) , https://github.com/OrgEleCho/EleCho.Internationalization +31) [https://github.com/OrgEleCho/EleCho.Internationalization]( https://github.com/OrgEleCho/EleCho.Internationalization) , https://github.com/OrgEleCho/EleCho.Internationalization Why I have not tested : issue opened https://github.com/ignatandrei/RSCG_Examples/issues/new?title=https://github.com/OrgEleCho/EleCho.Internationalization&body=https://github.com/OrgEleCho/EleCho.Internationalization -34) [https://github.com/stbychkov/AutoLoggerMessage]( https://github.com/stbychkov/AutoLoggerMessage) , https://github.com/stbychkov/AutoLoggerMessage +32) [https://github.com/stbychkov/AutoLoggerMessage]( https://github.com/stbychkov/AutoLoggerMessage) , https://github.com/stbychkov/AutoLoggerMessage -Why I have not tested : later +Why I have not tested : Microsoft have done same feature https://github.com/ignatandrei/RSCG_Examples/issues/new?title=https://github.com/stbychkov/AutoLoggerMessage&body=https://github.com/stbychkov/AutoLoggerMessage -35) [https://github.com/Stepami/visitor-net]( https://github.com/Stepami/visitor-net) , https://github.com/Stepami/visitor-net +33) [https://github.com/Stepami/visitor-net]( https://github.com/Stepami/visitor-net) , https://github.com/Stepami/visitor-net Why I have not tested : later https://github.com/ignatandrei/RSCG_Examples/issues/new?title=https://github.com/Stepami/visitor-net&body=https://github.com/Stepami/visitor-net -36) [https://github.com/svee4/RequiredStaticMembers]( https://github.com/svee4/RequiredStaticMembers) , https://github.com/svee4/RequiredStaticMembers +34) [https://github.com/svee4/RequiredStaticMembers]( https://github.com/svee4/RequiredStaticMembers) , https://github.com/svee4/RequiredStaticMembers Why I have not tested : issue opened https://github.com/ignatandrei/RSCG_Examples/issues/new?title=https://github.com/svee4/RequiredStaticMembers&body=https://github.com/svee4/RequiredStaticMembers -37) [https://github.com/SzymonHalucha/Minerals.AutoCommands]( https://github.com/SzymonHalucha/Minerals.AutoCommands) , https://github.com/SzymonHalucha/Minerals.AutoCommands +35) [https://github.com/SzymonHalucha/Minerals.AutoCommands]( https://github.com/SzymonHalucha/Minerals.AutoCommands) , https://github.com/SzymonHalucha/Minerals.AutoCommands Why I have not tested : later https://github.com/ignatandrei/RSCG_Examples/issues/new?title=https://github.com/SzymonHalucha/Minerals.AutoCommands&body=https://github.com/SzymonHalucha/Minerals.AutoCommands -38) [https://github.com/Teleopti/Saspect]( https://github.com/Teleopti/Saspect) , https://github.com/Teleopti/Saspect +36) [https://github.com/Teleopti/Saspect]( https://github.com/Teleopti/Saspect) , https://github.com/Teleopti/Saspect Why I have not tested : later https://github.com/ignatandrei/RSCG_Examples/issues/new?title=https://github.com/Teleopti/Saspect&body=https://github.com/Teleopti/Saspect -39) [https://github.com/TheFo2sh/AsyncFlow]( https://github.com/TheFo2sh/AsyncFlow) , https://github.com/TheFo2sh/AsyncFlow +37) [https://github.com/TheFo2sh/AsyncFlow]( https://github.com/TheFo2sh/AsyncFlow) , https://github.com/TheFo2sh/AsyncFlow -Why I have not tested : later +Why I have not tested : too complicated https://github.com/ignatandrei/RSCG_Examples/issues/new?title=https://github.com/TheFo2sh/AsyncFlow&body=https://github.com/TheFo2sh/AsyncFlow -40) [https://github.com/wieslawsoltes/ReactiveGenerator]( https://github.com/wieslawsoltes/ReactiveGenerator) , https://github.com/wieslawsoltes/ReactiveGenerator +38) [https://github.com/wieslawsoltes/ReactiveGenerator]( https://github.com/wieslawsoltes/ReactiveGenerator) , https://github.com/wieslawsoltes/ReactiveGenerator -Why I have not tested : later +Why I have not tested : too complicated https://github.com/ignatandrei/RSCG_Examples/issues/new?title=https://github.com/wieslawsoltes/ReactiveGenerator&body=https://github.com/wieslawsoltes/ReactiveGenerator -41) [Intellenum]( https://github.com/SteveDunn/Intellenum) , https://github.com/SteveDunn/Intellenum +39) [Intellenum]( https://github.com/SteveDunn/Intellenum) , https://github.com/SteveDunn/Intellenum Why I have not tested : not understand how to use https://github.com/ignatandrei/RSCG_Examples/issues/new?title=Intellenum&body=https://github.com/SteveDunn/Intellenum -42) [laker]( https://github.com/Lakerfield/Lakerfield.Rpc) , https://github.com/Lakerfield/Lakerfield.Rpc +40) [laker]( https://github.com/Lakerfield/Lakerfield.Rpc) , https://github.com/Lakerfield/Lakerfield.Rpc -Why I have not tested : later +Why I have not tested : too complicated https://github.com/ignatandrei/RSCG_Examples/issues/new?title=laker&body=https://github.com/Lakerfield/Lakerfield.Rpc -43) [LoggingDecoratorGenerator]( https://github.com/DavidFineboym/LoggingDecoratorGenerator) , https://github.com/DavidFineboym/LoggingDecoratorGenerator +41) [LoggingDecoratorGenerator]( https://github.com/DavidFineboym/LoggingDecoratorGenerator) , https://github.com/DavidFineboym/LoggingDecoratorGenerator Why I have not tested : Microsoft have done same feature https://github.com/ignatandrei/RSCG_Examples/issues/new?title=LoggingDecoratorGenerator&body=https://github.com/DavidFineboym/LoggingDecoratorGenerator -44) [lucide-blazor]( https://github.com/brecht-vde/lucide-blazor/) , https://github.com/brecht-vde/lucide-blazor/ +42) [lucide-blazor]( https://github.com/brecht-vde/lucide-blazor/) , https://github.com/brecht-vde/lucide-blazor/ Why I have not tested : issue opened https://github.com/ignatandrei/RSCG_Examples/issues/new?title=lucide-blazor&body=https://github.com/brecht-vde/lucide-blazor/ -45) [ManagedDotnetProfiler]( https://github.com/kevingosse/ManagedDotnetProfiler) , https://github.com/kevingosse/ManagedDotnetProfiler +43) [ManagedDotnetProfiler]( https://github.com/kevingosse/ManagedDotnetProfiler) , https://github.com/kevingosse/ManagedDotnetProfiler -Why I have not tested : later +Why I have not tested : too complicated https://github.com/ignatandrei/RSCG_Examples/issues/new?title=ManagedDotnetProfiler&body=https://github.com/kevingosse/ManagedDotnetProfiler -46) [Maui.BindableProperty.Generator]( https://github.com/rrmanzano/maui-bindableproperty-generator) , https://github.com/rrmanzano/maui-bindableproperty-generator +44) [Maui.BindableProperty.Generator]( https://github.com/rrmanzano/maui-bindableproperty-generator) , https://github.com/rrmanzano/maui-bindableproperty-generator Why I have not tested : later https://github.com/ignatandrei/RSCG_Examples/issues/new?title=Maui.BindableProperty.Generator&body=https://github.com/rrmanzano/maui-bindableproperty-generator -47) [Minerals.AutoCQRS]( https://github.com/SzymonHalucha/Minerals.AutoCQRS) , https://github.com/SzymonHalucha/Minerals.AutoCQRS +45) [Minerals.AutoCQRS]( https://github.com/SzymonHalucha/Minerals.AutoCQRS) , https://github.com/SzymonHalucha/Minerals.AutoCQRS Why I have not tested : later https://github.com/ignatandrei/RSCG_Examples/issues/new?title=Minerals.AutoCQRS&body=https://github.com/SzymonHalucha/Minerals.AutoCQRS -48) [Minerals.AutoDomain]( https://github.com/SzymonHalucha/Minerals.AutoDomain) , https://github.com/SzymonHalucha/Minerals.AutoDomain +46) [Minerals.AutoDomain]( https://github.com/SzymonHalucha/Minerals.AutoDomain) , https://github.com/SzymonHalucha/Minerals.AutoDomain Why I have not tested : later https://github.com/ignatandrei/RSCG_Examples/issues/new?title=Minerals.AutoDomain&body=https://github.com/SzymonHalucha/Minerals.AutoDomain -49) [MvvmGen]( https://github.com/thomasclaudiushuber/mvvmgen) , https://github.com/thomasclaudiushuber/mvvmgen +47) [MvvmGen]( https://github.com/thomasclaudiushuber/mvvmgen) , https://github.com/thomasclaudiushuber/mvvmgen Why I have not tested : later https://github.com/ignatandrei/RSCG_Examples/issues/new?title=MvvmGen&body=https://github.com/thomasclaudiushuber/mvvmgen -50) [observable]( https://github.com/notanaverageman/Bindables) , https://github.com/notanaverageman/Bindables +48) [observable]( https://github.com/notanaverageman/Bindables) , https://github.com/notanaverageman/Bindables Why I have not tested : later https://github.com/ignatandrei/RSCG_Examples/issues/new?title=observable&body=https://github.com/notanaverageman/Bindables -51) [Overloader]( https://github.com/emptycoder/Overloader) , https://github.com/emptycoder/Overloader - -Why I have not tested : later - -https://github.com/ignatandrei/RSCG_Examples/issues/new?title=Overloader&body=https://github.com/emptycoder/Overloader - +49) [PolySharp]( https://github.com/Sergio0694/PolySharp) , https://github.com/Sergio0694/PolySharp -52) [PolySharp]( https://github.com/Sergio0694/PolySharp) , https://github.com/Sergio0694/PolySharp - -Why I have not tested : later +Why I have not tested : too complicated https://github.com/ignatandrei/RSCG_Examples/issues/new?title=PolySharp&body=https://github.com/Sergio0694/PolySharp -53) [RazorGen]( https://github.com/dartk/RazorGen) , https://github.com/dartk/RazorGen +50) [RazorGen]( https://github.com/dartk/RazorGen) , https://github.com/dartk/RazorGen Why I have not tested : later https://github.com/ignatandrei/RSCG_Examples/issues/new?title=RazorGen&body=https://github.com/dartk/RazorGen -54) [SerdeDn]( https://github.com/serdedotnet/serde) , https://github.com/serdedotnet/serde +51) [SerdeDn]( https://github.com/serdedotnet/serde) , https://github.com/serdedotnet/serde Why I have not tested : serializer. Done by MSFT with System.Text.Json https://github.com/ignatandrei/RSCG_Examples/issues/new?title=SerdeDn&body=https://github.com/serdedotnet/serde -55) [SogePoco]( https://github.com/d-p-y/SogePoco) , https://github.com/d-p-y/SogePoco +52) [SogePoco]( https://github.com/d-p-y/SogePoco) , https://github.com/d-p-y/SogePoco -Why I have not tested : later +Why I have not tested : too complicated https://github.com/ignatandrei/RSCG_Examples/issues/new?title=SogePoco&body=https://github.com/d-p-y/SogePoco -56) [SourceCrafter.HttpServiceClientGenerator]( https://github.com/pedro-gilmora/SourceCrafter.HttpServiceClientGenerator/) , https://github.com/pedro-gilmora/SourceCrafter.HttpServiceClientGenerator/ +53) [SourceCrafter.HttpServiceClientGenerator]( https://github.com/pedro-gilmora/SourceCrafter.HttpServiceClientGenerator/) , https://github.com/pedro-gilmora/SourceCrafter.HttpServiceClientGenerator/ Why I have not tested : later https://github.com/ignatandrei/RSCG_Examples/issues/new?title=SourceCrafter.HttpServiceClientGenerator&body=https://github.com/pedro-gilmora/SourceCrafter.HttpServiceClientGenerator/ -57) [ST.NSwag.ServerSourceGenerator]( https://github.com/s-tarasov/ST.NSwag.ServerSourceGenerator) , https://github.com/s-tarasov/ST.NSwag.ServerSourceGenerator +54) [ST.NSwag.ServerSourceGenerator]( https://github.com/s-tarasov/ST.NSwag.ServerSourceGenerator) , https://github.com/s-tarasov/ST.NSwag.ServerSourceGenerator Why I have not tested : later https://github.com/ignatandrei/RSCG_Examples/issues/new?title=ST.NSwag.ServerSourceGenerator&body=https://github.com/s-tarasov/ST.NSwag.ServerSourceGenerator -58) [StrongInject]( https://github.com/YairHalberstadt/stronginject/) , https://github.com/YairHalberstadt/stronginject/ +55) [StrongInject]( https://github.com/YairHalberstadt/stronginject/) , https://github.com/YairHalberstadt/stronginject/ Why I have not tested : later https://github.com/ignatandrei/RSCG_Examples/issues/new?title=StrongInject&body=https://github.com/YairHalberstadt/stronginject/ -59) [TeuJson]( https://github.com/Terria-K/TeuJson) , https://github.com/Terria-K/TeuJson +56) [TeuJson]( https://github.com/Terria-K/TeuJson) , https://github.com/Terria-K/TeuJson Why I have not tested : json a class, was done in System.Text.Json https://github.com/ignatandrei/RSCG_Examples/issues/new?title=TeuJson&body=https://github.com/Terria-K/TeuJson -60) [Tinyhand]( https://github.com/archi-Doc/Tinyhand) , https://github.com/archi-Doc/Tinyhand +57) [Tinyhand]( https://github.com/archi-Doc/Tinyhand) , https://github.com/archi-Doc/Tinyhand Why I have not tested : tried, need documentation https://github.com/ignatandrei/RSCG_Examples/issues/new?title=Tinyhand&body=https://github.com/archi-Doc/Tinyhand -61) [TupleOverloadGenerator]( https://github.com/ProphetLamb/TupleOverloadGenerator) , https://github.com/ProphetLamb/TupleOverloadGenerator +58) [TupleOverloadGenerator]( https://github.com/ProphetLamb/TupleOverloadGenerator) , https://github.com/ProphetLamb/TupleOverloadGenerator -Why I have not tested : later +Why I have not tested : too complicated https://github.com/ignatandrei/RSCG_Examples/issues/new?title=TupleOverloadGenerator&body=https://github.com/ProphetLamb/TupleOverloadGenerator -62) [TypealizR]( https://github.com/earloc/TypealizR) , https://github.com/earloc/TypealizR +59) [TypealizR]( https://github.com/earloc/TypealizR) , https://github.com/earloc/TypealizR Why I have not tested : depends on Microsoft.Extensions.Localization https://github.com/ignatandrei/RSCG_Examples/issues/new?title=TypealizR&body=https://github.com/earloc/TypealizR -63) [UnitTestBlazor]( https://github.com/bUnit-dev/bUnit) , https://github.com/bUnit-dev/bUnit +60) [UnitTestBlazor]( https://github.com/bUnit-dev/bUnit) , https://github.com/bUnit-dev/bUnit Why I have not tested : issue opened https://github.com/ignatandrei/RSCG_Examples/issues/new?title=UnitTestBlazor&body=https://github.com/bUnit-dev/bUnit -64) [ValueLink]( https://github.com/archi-Doc/ValueLink) , https://github.com/archi-Doc/ValueLink +61) [ValueLink]( https://github.com/archi-Doc/ValueLink) , https://github.com/archi-Doc/ValueLink -Why I have not tested : later +Why I have not tested : too complicated https://github.com/ignatandrei/RSCG_Examples/issues/new?title=ValueLink&body=https://github.com/archi-Doc/ValueLink -65) [VisitorPatternGenerator]( https://github.com/hikarin522/VisitorPatternGenerator/) , https://github.com/hikarin522/VisitorPatternGenerator/ +62) [VisitorPatternGenerator]( https://github.com/hikarin522/VisitorPatternGenerator/) , https://github.com/hikarin522/VisitorPatternGenerator/ Why I have not tested : issue opened https://github.com/ignatandrei/RSCG_Examples/issues/new?title=VisitorPatternGenerator&body=https://github.com/hikarin522/VisitorPatternGenerator/ -66) [Visor]( https://github.com/Tinkoff/Visor) , https://github.com/Tinkoff/Visor - -Why I have not tested : later - -https://github.com/ignatandrei/RSCG_Examples/issues/new?title=Visor&body=https://github.com/Tinkoff/Visor - - -67) [WrapperValueObject]( https://github.com/martinothamar/WrapperValueObject) , https://github.com/martinothamar/WrapperValueObject +63) [WrapperValueObject]( https://github.com/martinothamar/WrapperValueObject) , https://github.com/martinothamar/WrapperValueObject Why I have not tested : not maintained as in readme https://github.com/ignatandrei/RSCG_Examples/issues/new?title=WrapperValueObject&body=https://github.com/martinothamar/WrapperValueObject -## Do not want to test 110 ( old ISourceGenerator ) +## Do not want to test 111 ( old ISourceGenerator )
Expand @@ -6271,7 +6265,13 @@ Why I have not tested : old ISourceGenerator -110) [Xtz.StronglyTyped]( https://github.com/dev-experience/Xtz.StronglyTyped) , https://github.com/dev-experience/Xtz.StronglyTyped +110) [Visor]( https://github.com/Tinkoff/Visor) , https://github.com/Tinkoff/Visor + +Why I have not tested : archived + + + +111) [Xtz.StronglyTyped]( https://github.com/dev-experience/Xtz.StronglyTyped) , https://github.com/dev-experience/Xtz.StronglyTyped Why I have not tested : old ISourceGenerator diff --git a/later.md b/later.md index 35597556f..378a61266 100644 --- a/later.md +++ b/later.md @@ -1,6 +1,6 @@ # Just later -## Latest Update : 2025-08-13 => 13 August 2025 +## Latest Update : 2025-08-14 => 14 August 2025 @@ -8,265 +8,127 @@ -1) [AdaskoTheBeAsT.Identity.Dapper]( https://github.com/AdaskoTheBeAsT/AdaskoTheBeAsT.Identity.Dapper) , https://github.com/AdaskoTheBeAsT/AdaskoTheBeAsT.Identity.Dapper +1) [BigMachines]( https://github.com/archi-Doc/BigMachines) , https://github.com/archi-Doc/BigMachines Why I have not tested : later -2) [AttributeFactoryGenerator]( https://github.com/PaulBraetz/AttributeFactoryGenerator) , https://github.com/PaulBraetz/AttributeFactoryGenerator +2) [Dexie]( https://github.com/b-straub/DexieNET) , https://github.com/b-straub/DexieNET Why I have not tested : later -3) [BigMachines]( https://github.com/archi-Doc/BigMachines) , https://github.com/archi-Doc/BigMachines +3) [epj.RouteGenerator]( https://github.com/ewerspej/epj.RouteGenerator) , https://github.com/ewerspej/epj.RouteGenerator Why I have not tested : later -4) [Dexie]( https://github.com/b-straub/DexieNET) , https://github.com/b-straub/DexieNET +4) [FastEndpoints]( https://github.com/FastEndpoints/FastEndpoints) , https://github.com/FastEndpoints/FastEndpoints Why I have not tested : later -5) [epj.RouteGenerator]( https://github.com/ewerspej/epj.RouteGenerator) , https://github.com/ewerspej/epj.RouteGenerator +5) [GRPC-Mock-Server]( https://github.com/cezarypiatek/GRPC-Mock-Server) , https://github.com/cezarypiatek/GRPC-Mock-Server Why I have not tested : later -6) [FastEndpoints]( https://github.com/FastEndpoints/FastEndpoints) , https://github.com/FastEndpoints/FastEndpoints +6) [https://github.com/borisdj/CsCodeGenerator]( https://github.com/borisdj/CsCodeGenerator) , https://github.com/borisdj/CsCodeGenerator Why I have not tested : later -7) [FluentAssertions.Eventual]( https://github.com/mazharenko/FluentAssertions.Eventual) , https://github.com/mazharenko/FluentAssertions.Eventual +7) [https://github.com/buchmiet/FastFsm]( https://github.com/buchmiet/FastFsm) , https://github.com/buchmiet/FastFsm Why I have not tested : later -8) [GRPC-Mock-Server]( https://github.com/cezarypiatek/GRPC-Mock-Server) , https://github.com/cezarypiatek/GRPC-Mock-Server +8) [https://github.com/chickensoft-games/LogicBlocks]( https://github.com/chickensoft-games/LogicBlocks) , https://github.com/chickensoft-games/LogicBlocks Why I have not tested : later -9) [H.NSwag.Generator]( https://github.com/HavenDV/H.NSwag.Generator) , https://github.com/HavenDV/H.NSwag.Generator +9) [https://github.com/ionite34/MinimalApiMapper]( https://github.com/ionite34/MinimalApiMapper) , https://github.com/ionite34/MinimalApiMapper Why I have not tested : later -10) [Hsu.Sg.Proxy]( https://github.com/hsu-net/source-generators/) , https://github.com/hsu-net/source-generators/ +10) [https://github.com/Stepami/visitor-net]( https://github.com/Stepami/visitor-net) , https://github.com/Stepami/visitor-net Why I have not tested : later -11) [https://github.com/AlexNav73/CoreCraft]( https://github.com/AlexNav73/CoreCraft) , https://github.com/AlexNav73/CoreCraft +11) [https://github.com/SzymonHalucha/Minerals.AutoCommands]( https://github.com/SzymonHalucha/Minerals.AutoCommands) , https://github.com/SzymonHalucha/Minerals.AutoCommands Why I have not tested : later -12) [https://github.com/Atoen/TextLocalizer]( https://github.com/Atoen/TextLocalizer) , https://github.com/Atoen/TextLocalizer +12) [https://github.com/Teleopti/Saspect]( https://github.com/Teleopti/Saspect) , https://github.com/Teleopti/Saspect Why I have not tested : later -13) [https://github.com/bjornhellander/TestInheritanceGenerator]( https://github.com/bjornhellander/TestInheritanceGenerator) , https://github.com/bjornhellander/TestInheritanceGenerator +13) [Maui.BindableProperty.Generator]( https://github.com/rrmanzano/maui-bindableproperty-generator) , https://github.com/rrmanzano/maui-bindableproperty-generator Why I have not tested : later -14) [https://github.com/borisdj/CsCodeGenerator]( https://github.com/borisdj/CsCodeGenerator) , https://github.com/borisdj/CsCodeGenerator +14) [Minerals.AutoCQRS]( https://github.com/SzymonHalucha/Minerals.AutoCQRS) , https://github.com/SzymonHalucha/Minerals.AutoCQRS Why I have not tested : later -15) [https://github.com/buchmiet/FastFsm]( https://github.com/buchmiet/FastFsm) , https://github.com/buchmiet/FastFsm +15) [Minerals.AutoDomain]( https://github.com/SzymonHalucha/Minerals.AutoDomain) , https://github.com/SzymonHalucha/Minerals.AutoDomain Why I have not tested : later -16) [https://github.com/chickensoft-games/LogicBlocks]( https://github.com/chickensoft-games/LogicBlocks) , https://github.com/chickensoft-games/LogicBlocks +16) [MvvmGen]( https://github.com/thomasclaudiushuber/mvvmgen) , https://github.com/thomasclaudiushuber/mvvmgen Why I have not tested : later -17) [https://github.com/eddievelasquez/IntercodeToolbox]( https://github.com/eddievelasquez/IntercodeToolbox) , https://github.com/eddievelasquez/IntercodeToolbox +17) [observable]( https://github.com/notanaverageman/Bindables) , https://github.com/notanaverageman/Bindables Why I have not tested : later -18) [https://github.com/inputfalken/Dynatello]( https://github.com/inputfalken/Dynatello) , https://github.com/inputfalken/Dynatello +18) [RazorGen]( https://github.com/dartk/RazorGen) , https://github.com/dartk/RazorGen Why I have not tested : later -19) [https://github.com/ionite34/MinimalApiMapper]( https://github.com/ionite34/MinimalApiMapper) , https://github.com/ionite34/MinimalApiMapper +19) [SourceCrafter.HttpServiceClientGenerator]( https://github.com/pedro-gilmora/SourceCrafter.HttpServiceClientGenerator/) , https://github.com/pedro-gilmora/SourceCrafter.HttpServiceClientGenerator/ Why I have not tested : later -20) [https://github.com/JasonBock/CslaGeneratorSerialization]( https://github.com/JasonBock/CslaGeneratorSerialization) , https://github.com/JasonBock/CslaGeneratorSerialization +20) [ST.NSwag.ServerSourceGenerator]( https://github.com/s-tarasov/ST.NSwag.ServerSourceGenerator) , https://github.com/s-tarasov/ST.NSwag.ServerSourceGenerator Why I have not tested : later -21) [https://github.com/MarkFl12/BlazorLinks]( https://github.com/MarkFl12/BlazorLinks) , https://github.com/MarkFl12/BlazorLinks - -Why I have not tested : later - - - -22) [https://github.com/stbychkov/AutoLoggerMessage]( https://github.com/stbychkov/AutoLoggerMessage) , https://github.com/stbychkov/AutoLoggerMessage - -Why I have not tested : later - - - -23) [https://github.com/Stepami/visitor-net]( https://github.com/Stepami/visitor-net) , https://github.com/Stepami/visitor-net - -Why I have not tested : later - - - -24) [https://github.com/SzymonHalucha/Minerals.AutoCommands]( https://github.com/SzymonHalucha/Minerals.AutoCommands) , https://github.com/SzymonHalucha/Minerals.AutoCommands - -Why I have not tested : later - - - -25) [https://github.com/Teleopti/Saspect]( https://github.com/Teleopti/Saspect) , https://github.com/Teleopti/Saspect - -Why I have not tested : later - - - -26) [https://github.com/TheFo2sh/AsyncFlow]( https://github.com/TheFo2sh/AsyncFlow) , https://github.com/TheFo2sh/AsyncFlow - -Why I have not tested : later - - - -27) [https://github.com/wieslawsoltes/ReactiveGenerator]( https://github.com/wieslawsoltes/ReactiveGenerator) , https://github.com/wieslawsoltes/ReactiveGenerator - -Why I have not tested : later - - - -28) [laker]( https://github.com/Lakerfield/Lakerfield.Rpc) , https://github.com/Lakerfield/Lakerfield.Rpc - -Why I have not tested : later - - - -29) [ManagedDotnetProfiler]( https://github.com/kevingosse/ManagedDotnetProfiler) , https://github.com/kevingosse/ManagedDotnetProfiler - -Why I have not tested : later - - - -30) [Maui.BindableProperty.Generator]( https://github.com/rrmanzano/maui-bindableproperty-generator) , https://github.com/rrmanzano/maui-bindableproperty-generator - -Why I have not tested : later - - - -31) [Minerals.AutoCQRS]( https://github.com/SzymonHalucha/Minerals.AutoCQRS) , https://github.com/SzymonHalucha/Minerals.AutoCQRS - -Why I have not tested : later - - - -32) [Minerals.AutoDomain]( https://github.com/SzymonHalucha/Minerals.AutoDomain) , https://github.com/SzymonHalucha/Minerals.AutoDomain - -Why I have not tested : later - - - -33) [MvvmGen]( https://github.com/thomasclaudiushuber/mvvmgen) , https://github.com/thomasclaudiushuber/mvvmgen - -Why I have not tested : later - - - -34) [observable]( https://github.com/notanaverageman/Bindables) , https://github.com/notanaverageman/Bindables - -Why I have not tested : later - - - -35) [Overloader]( https://github.com/emptycoder/Overloader) , https://github.com/emptycoder/Overloader - -Why I have not tested : later - - - -36) [PolySharp]( https://github.com/Sergio0694/PolySharp) , https://github.com/Sergio0694/PolySharp - -Why I have not tested : later - - - -37) [RazorGen]( https://github.com/dartk/RazorGen) , https://github.com/dartk/RazorGen - -Why I have not tested : later - - - -38) [SogePoco]( https://github.com/d-p-y/SogePoco) , https://github.com/d-p-y/SogePoco - -Why I have not tested : later - - - -39) [SourceCrafter.HttpServiceClientGenerator]( https://github.com/pedro-gilmora/SourceCrafter.HttpServiceClientGenerator/) , https://github.com/pedro-gilmora/SourceCrafter.HttpServiceClientGenerator/ - -Why I have not tested : later - - - -40) [ST.NSwag.ServerSourceGenerator]( https://github.com/s-tarasov/ST.NSwag.ServerSourceGenerator) , https://github.com/s-tarasov/ST.NSwag.ServerSourceGenerator - -Why I have not tested : later - - - -41) [StrongInject]( https://github.com/YairHalberstadt/stronginject/) , https://github.com/YairHalberstadt/stronginject/ - -Why I have not tested : later - - - -42) [TupleOverloadGenerator]( https://github.com/ProphetLamb/TupleOverloadGenerator) , https://github.com/ProphetLamb/TupleOverloadGenerator - -Why I have not tested : later - - - -43) [ValueLink]( https://github.com/archi-Doc/ValueLink) , https://github.com/archi-Doc/ValueLink - -Why I have not tested : later - - - -44) [Visor]( https://github.com/Tinkoff/Visor) , https://github.com/Tinkoff/Visor +21) [StrongInject]( https://github.com/YairHalberstadt/stronginject/) , https://github.com/YairHalberstadt/stronginject/ Why I have not tested : later diff --git a/v2/Generator/DocusaurusExample.txt b/v2/Generator/DocusaurusExample.txt index d627cd14e..60b9aff91 100644 --- a/v2/Generator/DocusaurusExample.txt +++ b/v2/Generator/DocusaurusExample.txt @@ -95,9 +95,9 @@ This is the CSharp Project that references **{{ Description.Generator.Name }}** ### Generated Files +{{~ if HasFilesGenerated ~}} Those are taken from $(BaseIntermediateOutputPath)\GX - {{~ for fileContent in Description.Data.outputFiles.generatedFiles ~}} @@ -111,7 +111,7 @@ Those are taken from $(BaseIntermediateOutputPath)\GX {{~ end ~}} - +{{~ end ~}} ## Useful ### Download Example (.NET C#) diff --git a/v2/Generator/MultiGeneratorV2.cs b/v2/Generator/MultiGeneratorV2.cs index c34363a8f..148f3ead0 100644 --- a/v2/Generator/MultiGeneratorV2.cs +++ b/v2/Generator/MultiGeneratorV2.cs @@ -924,10 +924,10 @@ private async Task WroteDocusaurus(Description it, string pathDocusaurus) .Where(loop=>loop.Generator?.Name != it.Generator?.Name) .OrderBy(it=>it.Generator?.Name) .ToArray(); - + bool HasFilesGenerated = it?.Data?.outputFiles?.HasFilesGenerated() ?? false; var template = await File.ReadAllTextAsync("DocusaurusExample.txt"); var templateScriban = Scriban.Template.Parse(template); - var output = templateScriban.Render(new {Description=it, otherDesc, category}, member => member.Name); + var output = templateScriban.Render(new {Description=it,HasFilesGenerated, otherDesc, category}, member => member.Name); output = output .Replace(" { ", " \\{ ") .Replace(" } ", " \\} ") diff --git a/v2/Generator/OutputFiles.cs b/v2/Generator/OutputFiles.cs index 98265de4b..f0294133f 100644 --- a/v2/Generator/OutputFiles.cs +++ b/v2/Generator/OutputFiles.cs @@ -39,6 +39,8 @@ public string NameCsproj } public string[]? excludeDirectoryGenerated { get; internal set; } public string[]? includeAdditionalFiles { get; internal set; } + public bool HasFilesGenerated() => generatedFiles?.Length > 0; + public async Task GatherData(string nuget) { diff --git a/v2/Generator/all.csv b/v2/Generator/all.csv index bbe943819..0638e8e55 100644 --- a/v2/Generator/all.csv +++ b/v2/Generator/all.csv @@ -224,3 +224,4 @@ Nr,Key,Source,Category 223,JinShil.MixinSourceGenerator, https://github.com/JinShil/JinShil.MixinSourceGenerator,Mixin 224,FactoryGenerator.Abstractions, https://github.com/ivmazurenko/factory-generator,DependencyInjection 225,Schema, https://github.com/MeltyPlayer/Schema,Serializer +226,requiredenum, https://github.com/emptycoder/RequiredEnum,Enum diff --git a/v2/RSCGExamplesData/GeneratorDataRec.json b/v2/RSCGExamplesData/GeneratorDataRec.json index 10db53d43..3faa78c9b 100644 --- a/v2/RSCGExamplesData/GeneratorDataRec.json +++ b/v2/RSCGExamplesData/GeneratorDataRec.json @@ -1359,5 +1359,11 @@ "Category": 16, "dtStart": "2025-08-13T00:00:00", "show": true - } + }, +{ + "ID":"requiredenum", + "Category": 19, + "dtStart": "2025-08-14T00:00:00", + "show": true +} ] \ No newline at end of file diff --git a/v2/RSCGExamplesData/NoExample.json b/v2/RSCGExamplesData/NoExample.json index 529504a96..afbb10ea7 100644 --- a/v2/RSCGExamplesData/NoExample.json +++ b/v2/RSCGExamplesData/NoExample.json @@ -635,11 +635,6 @@ "name": "Dexie https://github.com/b-straub/DexieNET", "why": "later" }, - { - "ID": 134, - "name": "Overloader https://github.com/emptycoder/RequiredEnum", - "why": "later" - }, { "ID": 135, "name": "CsvMole https://github.com/pippinmole/CsvMole.NET", diff --git a/v2/book/examples/requiredenum.html b/v2/book/examples/requiredenum.html new file mode 100644 index 000000000..4e17e7727 --- /dev/null +++ b/v2/book/examples/requiredenum.html @@ -0,0 +1,54 @@ + +

RSCG nr 226 : requiredenum

+ +

Info

+Nuget : https://www.nuget.org/packages/requiredenum/ + +

You can find more details at : https://github.com/emptycoder/RequiredEnum

+ +

Author :Yaroslav

+ +

Source: https://github.com/emptycoder/RequiredEnum

+ +

About

+ +Raise an error at compile time if not have switch handle case all enums values + +

+ How to use +

+

+ Add reference to the requiredenum in the csproj +

+ + +

This was for me the starting code

+ +
+ I have coded the file Program.cs +
+ +
+ +
+ I have coded the file RequiredCarTypes.cs +
+ +
+

And here are the generated files

+ +

+ You can download the code and this page as pdf from + + https://ignatandrei.github.io/RSCG_Examples/v2/docs/requiredenum + +

+ + +

+ You can see the whole list at + + https://ignatandrei.github.io/RSCG_Examples/v2/docs/List-of-RSCG + +

+ diff --git a/v2/book/list.html b/v2/book/list.html index 9286814a0..de4756f3f 100644 --- a/v2/book/list.html +++ b/v2/book/list.html @@ -17,7 +17,7 @@

-This is the list of 225 RSCG with examples => +This is the list of 226 RSCG with examples =>

@@ -926,6 +926,10 @@

+ + + +
225 Schema
226requiredenum
diff --git a/v2/book/pandocHTML.yaml b/v2/book/pandocHTML.yaml index faa90a4d7..b85ff81f3 100644 --- a/v2/book/pandocHTML.yaml +++ b/v2/book/pandocHTML.yaml @@ -239,6 +239,7 @@ input-files: - examples/JinShil.MixinSourceGenerator.html - examples/FactoryGenerator.Abstractions.html - examples/Schema.html +- examples/requiredenum.html # or you may use input-file: with a single value # defaults: diff --git a/v2/rscg_examples/requiredenum/description.json b/v2/rscg_examples/requiredenum/description.json new file mode 100644 index 000000000..6097c60d8 --- /dev/null +++ b/v2/rscg_examples/requiredenum/description.json @@ -0,0 +1,22 @@ +{ + "generator":{ + "name":"requiredenum", + "nuget":[ + "https://www.nuget.org/packages/requiredenum/" + ], + "link":"https://github.com/emptycoder/RequiredEnum", + "author":"Yaroslav", + "source":"https://github.com/emptycoder/RequiredEnum" + }, + "data":{ + "goodFor":["Raise an error at compile time if not have switch handle case all enums values "], + "csprojDemo":"EnumDemo.csproj", + "csFiles":["Program.cs","RequiredCarTypes.cs"], + "excludeDirectoryGenerated":[""], + "includeAdditionalFiles":[""] + }, + "links":{ + "blog":"", + "video":"" + } +} \ No newline at end of file diff --git a/v2/rscg_examples/requiredenum/nuget.txt b/v2/rscg_examples/requiredenum/nuget.txt new file mode 100644 index 000000000..6054dec55 --- /dev/null +++ b/v2/rscg_examples/requiredenum/nuget.txt @@ -0,0 +1 @@ +RequiredEnum is an open-source analyzer that helps handle all enum values for switch. \ No newline at end of file diff --git a/v2/rscg_examples/requiredenum/readme.txt b/v2/rscg_examples/requiredenum/readme.txt new file mode 100644 index 000000000..b4dd6801a --- /dev/null +++ b/v2/rscg_examples/requiredenum/readme.txt @@ -0,0 +1,36 @@ +

RequiredEnum

+ +RequiredEnum is an open-source analyzer that helps handle all enum values for switch. + +# Installation + +[NuGet](https://www.nuget.org/packages/RequiredEnum/): `dotnet add package requiredenum` + +# Usage + +Just add 'Required' prefix for any name of enum in your project and you will get the error when one of cases weren't handle in a switch statement. + +```csharp +var test = (RequiredNumbers) Random.Shared.Next(0, Enum.GetNames(typeof(RequiredNumbers)).Length); +switch (test) +{ + case RequiredNumbers.Zero: + break; + case RequiredNumbers.One: + break; + default: + throw new ArgumentOutOfRangeException(); +} + +internal enum RequiredNumbers +{ + Zero, + One, + Two +} +``` +This code will throw the error ('Two' case wasn't handle) and it can't be compiled. + +# License + +RequiredEnum distributed under [MIT](./LICENSE) license. diff --git a/v2/rscg_examples/requiredenum/src/.tours/requiredenum.tour b/v2/rscg_examples/requiredenum/src/.tours/requiredenum.tour new file mode 100644 index 000000000..bed869314 --- /dev/null +++ b/v2/rscg_examples/requiredenum/src/.tours/requiredenum.tour @@ -0,0 +1,30 @@ + +{ + "$schema": "https://aka.ms/codetour-schema", + "title": "requiredenum", + "steps": + [ + { + "file": "EnumDemo/EnumDemo.csproj", + "description": "First, we add Nuget [requiredenum](https://www.nuget.org/packages/requiredenum/) in csproj ", + "pattern": "requiredenum" + } + + ,{ + "file": "EnumDemo/RequiredCarTypes.cs", + "description": "File RequiredCarTypes.cs ", + "pattern": "this is the code" + } + + ,{ + "file": "EnumDemo/Program.cs", + "description": "File Program.cs \r\n>> dotnet run --project EnumDemo/EnumDemo.csproj ", + "pattern": "this is the code" + } + + + ], + + "ref": "main" + +} \ No newline at end of file diff --git a/v2/rscg_examples/requiredenum/src/EnumDemo.sln b/v2/rscg_examples/requiredenum/src/EnumDemo.sln new file mode 100644 index 000000000..ace1b5ec0 --- /dev/null +++ b/v2/rscg_examples/requiredenum/src/EnumDemo.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.14.36401.2 d17.14 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EnumDemo", "EnumDemo\EnumDemo.csproj", "{9D8848B1-F882-46F9-8036-C1C47BA503F0}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {9D8848B1-F882-46F9-8036-C1C47BA503F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9D8848B1-F882-46F9-8036-C1C47BA503F0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9D8848B1-F882-46F9-8036-C1C47BA503F0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9D8848B1-F882-46F9-8036-C1C47BA503F0}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {420BBB7E-4EC0-4A41-98F7-E573A6501983} + EndGlobalSection +EndGlobal diff --git a/v2/rscg_examples/requiredenum/src/EnumDemo/EnumDemo.csproj b/v2/rscg_examples/requiredenum/src/EnumDemo/EnumDemo.csproj new file mode 100644 index 000000000..219d0137c --- /dev/null +++ b/v2/rscg_examples/requiredenum/src/EnumDemo/EnumDemo.csproj @@ -0,0 +1,23 @@ + + + + Exe + net9.0 + enable + enable + + + + true + $(BaseIntermediateOutputPath)\GX + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + diff --git a/v2/rscg_examples/requiredenum/src/EnumDemo/Program.cs b/v2/rscg_examples/requiredenum/src/EnumDemo/Program.cs new file mode 100644 index 000000000..f9ae441ec --- /dev/null +++ b/v2/rscg_examples/requiredenum/src/EnumDemo/Program.cs @@ -0,0 +1,27 @@ +// See https://aka.ms/new-console-template for more information +using EnumDemo; + +Console.WriteLine("Hello, World!"); +RequiredCarTypes myCar = RequiredCarTypes.Tesla; +switch(myCar) +{ + //comment any case to see the error in action + case RequiredCarTypes.None: + Console.WriteLine("No car"); + break; + case RequiredCarTypes.Dacia: + Console.WriteLine("Dacia"); + break; + case RequiredCarTypes.Tesla: + Console.WriteLine("Tesla"); + break; + case RequiredCarTypes.BMW: + Console.WriteLine("BMW"); + break; + case RequiredCarTypes.Mercedes: + Console.WriteLine("Mercedes"); + break; + default: + Console.WriteLine("Unknown car"); + break; +} \ No newline at end of file diff --git a/v2/rscg_examples/requiredenum/src/EnumDemo/RequiredCarTypes.cs b/v2/rscg_examples/requiredenum/src/EnumDemo/RequiredCarTypes.cs new file mode 100644 index 000000000..26838eab1 --- /dev/null +++ b/v2/rscg_examples/requiredenum/src/EnumDemo/RequiredCarTypes.cs @@ -0,0 +1,10 @@ + +namespace EnumDemo; +public enum RequiredCarTypes +{ + None, + Dacia , + Tesla , + BMW , + Mercedes , +} diff --git a/v2/rscg_examples/requiredenum/video.json b/v2/rscg_examples/requiredenum/video.json new file mode 100644 index 000000000..96c6be744 --- /dev/null +++ b/v2/rscg_examples/requiredenum/video.json @@ -0,0 +1,39 @@ +{ + "scriptName": "requiredenum", + "steps": +[ + {"typeStep":"exec","arg":"clipchamp.exe launch"}, + {"typeStep":"text","arg": "Welcome to Roslyn Examples"}, + {"typeStep":"text","arg":"If you want to see more examples , see List Of RSCG"}, + {"typeStep":"browser","arg":"https://ignatandrei.github.io/RSCG_Examples/v2/docs/List-of-RSCG"}, + {"typeStep":"text","arg": "My name is Andrei Ignat and I am deeply fond of Roslyn Source Code Generator. "}, + +{"typeStep":"text","arg": "Today I will present requiredenum . Raise an error at compile time if not have switch handle case all enums values ."}, +{"typeStep":"browser","arg":"https://www.nuget.org/packages/requiredenum/"}, +{"typeStep":"text","arg": "The whole example is here"}, +{"typeStep":"browser","arg":"https://ignatandrei.github.io/RSCG_Examples/v2/docs/requiredenum"}, +{"typeStep":"text","arg": "You can download the code from here"}, +{"typeStep":"browser","arg":"https://ignatandrei.github.io/RSCG_Examples/v2/docs/requiredenum#download-example-net--c-"}, +{"typeStep":"text","arg":"Here is the code downloaded "}, +{"typeStep":"exec","arg":"explorer.exe /select,D:\\gth\\RSCG_Examples\\v2\\rscg_examples\\requiredenum\\src\\EnumDemo.sln"}, +{"typeStep":"text","arg": "So , let's start the project with Visual Studio Code "}, +{"typeStep":"stepvscode","arg": "-n D:\\gth\\RSCG_Examples\\v2\\rscg_examples\\requiredenum\\src"}, + +{"typeStep":"text","arg": "To use it ,you will put the Nuget requiredenum into the csproj "}, + +{"typeStep":"stepvscode","arg": "-r -g D:\\gth\\RSCG_Examples\\v2\\rscg_examples\\requiredenum\\src\\EnumDemo\\EnumDemo.csproj"}, + +{"typeStep":"text","arg": "And now I will show you an example of using requiredenum"}, + +{"typeStep":"hide","arg": "now execute the tour in VSCode"}, +{"typeStep":"tour", "arg": "src/.tours/"}, +{"typeStep":"text","arg":" And I will execute the project"}, +{"typeStep":"showproj", "arg":"EnumDemo.csproj"}, +{"typeStep":"text","arg":" This concludes the project"}, +{"typeStep":"waitseconds","arg":"30"}, +{"typeStep":"text","arg": "Remember, you can download the code from here"}, +{"typeStep":"browser","arg":"https://ignatandrei.github.io/RSCG_Examples/v2/docs/requiredenum#download-example-net--c-", +SpeakTest=" "}, +{"typeStep":"waitseconds","arg":"30"}, +] +} diff --git a/v2/rscg_examples_site/docs/Categories/Enum.md b/v2/rscg_examples_site/docs/Categories/Enum.md index 8bcb8eb3a..fad19917b 100644 --- a/v2/rscg_examples_site/docs/Categories/Enum.md +++ b/v2/rscg_examples_site/docs/Categories/Enum.md @@ -1,6 +1,6 @@

Enum

-Number RSCG: 10 +Number RSCG: 11 1 [CredFetoEnum](/docs/CredFetoEnum) @@ -21,4 +21,6 @@ Number RSCG: 10 9 [NetEscapades.EnumGenerators](/docs/NetEscapades.EnumGenerators) 10 [PMart.Enumeration](/docs/PMart.Enumeration) + + 11 [requiredenum](/docs/requiredenum) \ No newline at end of file diff --git a/v2/rscg_examples_site/docs/Categories/_PrimitiveEnum.mdx b/v2/rscg_examples_site/docs/Categories/_PrimitiveEnum.mdx index eb6a4604b..6229baad7 100644 --- a/v2/rscg_examples_site/docs/Categories/_PrimitiveEnum.mdx +++ b/v2/rscg_examples_site/docs/Categories/_PrimitiveEnum.mdx @@ -20,6 +20,8 @@ 10 [PMart.Enumeration](/docs/PMart.Enumeration) + 11 [requiredenum](/docs/requiredenum) + ### See category [Enum](/docs/Categories/Enum) diff --git a/v2/rscg_examples_site/docs/NoExamples.md b/v2/rscg_examples_site/docs/NoExamples.md index 323ffa940..80de0a846 100644 --- a/v2/rscg_examples_site/docs/NoExamples.md +++ b/v2/rscg_examples_site/docs/NoExamples.md @@ -8,7 +8,7 @@ title: RSCG Without Examples 1)AdaskoTheBeAsT.Identity.Dapper https://github.com/AdaskoTheBeAsT/AdaskoTheBeAsT.Identity.Dapper -Why I have not put example: later +Why I have not put example: too complicated 2)AjaxService.Gen https://github.com/MrAliSalehi/AjaxService @@ -28,7 +28,7 @@ Why I have not put example: old ISourceGenerator 6)AttributeFactoryGenerator https://github.com/PaulBraetz/AttributeFactoryGenerator -Why I have not put example: later +Why I have not put example: too complicated 7)AutoDeconstructable https://github.com/nemesissoft/Nemesis.TextParsers/tree/master/Nemesis.TextParsers.CodeGen/Deconstructable @@ -208,7 +208,7 @@ Why I have not put example: old ISourceGenerator 51)FluentAssertions.Eventual https://github.com/mazharenko/FluentAssertions.Eventual -Why I have not put example: later +Why I have not put example: atchived 52)FluentBuilder https://github.com/StefH/FluentBuilder @@ -248,469 +248,457 @@ Why I have not put example: old ISourceGenerator 61)H.NSwag.Generator https://github.com/HavenDV/H.NSwag.Generator -Why I have not put example: later +Why I have not put example: do not understand 62)Hexa.Protobuf https://github.com/HexaEngine/Hexa.Protobuf Why I have not put example: issue opened -63)Hsu.Sg.Proxy https://github.com/hsu-net/source-generators/ - -Why I have not put example: later - -64)HttpClientCodeGenerator https://github.com/Jalalx/HttpClientCodeGenerator +63)HttpClientCodeGenerator https://github.com/Jalalx/HttpClientCodeGenerator Why I have not put example: old ISourceGenerator -65)https://github.com/Agentew04/CliToolkit https://github.com/Agentew04/CliToolkit +64)https://github.com/Agentew04/CliToolkit https://github.com/Agentew04/CliToolkit Why I have not put example: issue opened -66)https://github.com/AlexNav73/CoreCraft https://github.com/AlexNav73/CoreCraft +65)https://github.com/AlexNav73/CoreCraft https://github.com/AlexNav73/CoreCraft -Why I have not put example: later +Why I have not put example: too complicated -67)https://github.com/Atoen/TextLocalizer https://github.com/Atoen/TextLocalizer +66)https://github.com/Atoen/TextLocalizer https://github.com/Atoen/TextLocalizer -Why I have not put example: later +Why I have not put example: too complicated -68)https://github.com/bjornhellander/TestInheritanceGenerator https://github.com/bjornhellander/TestInheritanceGenerator +67)https://github.com/bjornhellander/TestInheritanceGenerator https://github.com/bjornhellander/TestInheritanceGenerator -Why I have not put example: later +Why I have not put example: too complicated -69)https://github.com/borisdj/CsCodeGenerator https://github.com/borisdj/CsCodeGenerator +68)https://github.com/borisdj/CsCodeGenerator https://github.com/borisdj/CsCodeGenerator Why I have not put example: later -70)https://github.com/buchmiet/FastFsm https://github.com/buchmiet/FastFsm +69)https://github.com/buchmiet/FastFsm https://github.com/buchmiet/FastFsm Why I have not put example: later -71)https://github.com/chickensoft-games/LogicBlocks https://github.com/chickensoft-games/LogicBlocks +70)https://github.com/chickensoft-games/LogicBlocks https://github.com/chickensoft-games/LogicBlocks Why I have not put example: later -72)https://github.com/dgmjr-io/InterfaceGenerator https://github.com/dgmjr-io/InterfaceGenerator +71)https://github.com/dgmjr-io/InterfaceGenerator https://github.com/dgmjr-io/InterfaceGenerator Why I have not put example: issue opened -73)https://github.com/eddievelasquez/IntercodeToolbox https://github.com/eddievelasquez/IntercodeToolbox +72)https://github.com/eddievelasquez/IntercodeToolbox https://github.com/eddievelasquez/IntercodeToolbox -Why I have not put example: later +Why I have not put example: too complicated -74)https://github.com/GaoNian-NET/MapperToolkit https://github.com/GaoNian-NET/MapperToolkit +73)https://github.com/GaoNian-NET/MapperToolkit https://github.com/GaoNian-NET/MapperToolkit Why I have not put example: issue opened -75)https://github.com/inputfalken/Dynatello https://github.com/inputfalken/Dynatello - -Why I have not put example: later - -76)https://github.com/ionite34/MinimalApiMapper https://github.com/ionite34/MinimalApiMapper +74)https://github.com/inputfalken/Dynatello https://github.com/inputfalken/Dynatello -Why I have not put example: later +Why I have not put example: too complicated -77)https://github.com/JasonBock/CslaGeneratorSerialization https://github.com/JasonBock/CslaGeneratorSerialization +75)https://github.com/ionite34/MinimalApiMapper https://github.com/ionite34/MinimalApiMapper Why I have not put example: later -78)https://github.com/MarkFl12/BlazorLinks https://github.com/MarkFl12/BlazorLinks +76)https://github.com/JasonBock/CslaGeneratorSerialization https://github.com/JasonBock/CslaGeneratorSerialization -Why I have not put example: later +Why I have not put example: too complicated -79)https://github.com/nevsnirG/MinimalRichDomain https://github.com/nevsnirG/MinimalRichDomain +77)https://github.com/nevsnirG/MinimalRichDomain https://github.com/nevsnirG/MinimalRichDomain Why I have not put example: old ISourceGenerator -80)https://github.com/OrgEleCho/EleCho.Internationalization https://github.com/OrgEleCho/EleCho.Internationalization +78)https://github.com/OrgEleCho/EleCho.Internationalization https://github.com/OrgEleCho/EleCho.Internationalization Why I have not put example: issue opened -81)https://github.com/ramhari-dev/PropGenAoT https://github.com/ramhari-dev/PropGenAoT +79)https://github.com/ramhari-dev/PropGenAoT https://github.com/ramhari-dev/PropGenAoT Why I have not put example: no readme -82)https://github.com/stbychkov/AutoLoggerMessage https://github.com/stbychkov/AutoLoggerMessage +80)https://github.com/stbychkov/AutoLoggerMessage https://github.com/stbychkov/AutoLoggerMessage -Why I have not put example: later +Why I have not put example: Microsoft have done same feature -83)https://github.com/Stepami/visitor-net https://github.com/Stepami/visitor-net +81)https://github.com/Stepami/visitor-net https://github.com/Stepami/visitor-net Why I have not put example: later -84)https://github.com/svee4/RequiredStaticMembers https://github.com/svee4/RequiredStaticMembers +82)https://github.com/svee4/RequiredStaticMembers https://github.com/svee4/RequiredStaticMembers Why I have not put example: issue opened -85)https://github.com/SzymonHalucha/Minerals.AutoCommands https://github.com/SzymonHalucha/Minerals.AutoCommands +83)https://github.com/SzymonHalucha/Minerals.AutoCommands https://github.com/SzymonHalucha/Minerals.AutoCommands Why I have not put example: later -86)https://github.com/Teleopti/Saspect https://github.com/Teleopti/Saspect +84)https://github.com/Teleopti/Saspect https://github.com/Teleopti/Saspect Why I have not put example: later -87)https://github.com/TheFo2sh/AsyncFlow https://github.com/TheFo2sh/AsyncFlow +85)https://github.com/TheFo2sh/AsyncFlow https://github.com/TheFo2sh/AsyncFlow -Why I have not put example: later +Why I have not put example: too complicated -88)https://github.com/wieslawsoltes/ReactiveGenerator https://github.com/wieslawsoltes/ReactiveGenerator +86)https://github.com/wieslawsoltes/ReactiveGenerator https://github.com/wieslawsoltes/ReactiveGenerator -Why I have not put example: later +Why I have not put example: too complicated -89)HubClientProxyGenerator https://www.nuget.org/packages/Microsoft.AspNetCore.SignalR.Client.SourceGenerator +87)HubClientProxyGenerator https://www.nuget.org/packages/Microsoft.AspNetCore.SignalR.Client.SourceGenerator Why I have not put example: not having nuget, but having IIncrementalGenerator -90)Imp.NET https://github.com/DouglasDwyer/Imp.NET +88)Imp.NET https://github.com/DouglasDwyer/Imp.NET Why I have not put example: old ISourceGenerator -91)Intellenum https://github.com/SteveDunn/Intellenum +89)Intellenum https://github.com/SteveDunn/Intellenum Why I have not put example: not understand how to use -92)InterfaceGenerator https://github.com/daver32/InterfaceGenerator +90)InterfaceGenerator https://github.com/daver32/InterfaceGenerator Why I have not put example: old ISourceGenerator -93)IoTHubClientGenerator https://github.com/alonf/IoTHubClientGenerator +91)IoTHubClientGenerator https://github.com/alonf/IoTHubClientGenerator Why I have not put example: old ISourceGenerator -94)JsonByExampleGenerator https://github.com/hermanussen/JsonByExampleGenerator +92)JsonByExampleGenerator https://github.com/hermanussen/JsonByExampleGenerator Why I have not put example: old ISourceGenerator -95)JsonDeserializeResourceSourceGenerator https://github.com/musictopia2/JsonDeserializeResourceSourceGenerator +93)JsonDeserializeResourceSourceGenerator https://github.com/musictopia2/JsonDeserializeResourceSourceGenerator Why I have not put example: no readme -96)JsonMergePatch https://github.com/ladeak/JsonMergePatch +94)JsonMergePatch https://github.com/ladeak/JsonMergePatch Why I have not put example: old ISourceGenerator -97)JsonSerializerContextGenerator https://github.com/musictopia2/JsonSerializerContextGenerator +95)JsonSerializerContextGenerator https://github.com/musictopia2/JsonSerializerContextGenerator Why I have not put example: no readme -98)JsonSourceGenerator https://github.com/Pilchie/JsonSourceGenerator +96)JsonSourceGenerator https://github.com/Pilchie/JsonSourceGenerator Why I have not put example: not having nuget, but having IIncrementalGenerator -99)JsonSrcGen https://github.com/trampster/JsonSrcGen +97)JsonSrcGen https://github.com/trampster/JsonSrcGen Why I have not put example: old ISourceGenerator -100)kli.Localize https://github.com/kl1mm/localize +98)kli.Localize https://github.com/kl1mm/localize Why I have not put example: old ISourceGenerator -101)laker https://github.com/Lakerfield/Lakerfield.Rpc +99)laker https://github.com/Lakerfield/Lakerfield.Rpc -Why I have not put example: later +Why I have not put example: too complicated -102)lambdajection https://github.com/cythral/lambdajection +100)lambdajection https://github.com/cythral/lambdajection Why I have not put example: old ISourceGenerator -103)Lazysh https://github.com/B1Z0N/LazyshGen +101)Lazysh https://github.com/B1Z0N/LazyshGen Why I have not put example: old ISourceGenerator -104)LoggingDecoratorGenerator https://github.com/DavidFineboym/LoggingDecoratorGenerator +102)LoggingDecoratorGenerator https://github.com/DavidFineboym/LoggingDecoratorGenerator Why I have not put example: Microsoft have done same feature -105)lucide-blazor https://github.com/brecht-vde/lucide-blazor/ +103)lucide-blazor https://github.com/brecht-vde/lucide-blazor/ Why I have not put example: issue opened -106)ManagedDotnetProfiler https://github.com/kevingosse/ManagedDotnetProfiler +104)ManagedDotnetProfiler https://github.com/kevingosse/ManagedDotnetProfiler -Why I have not put example: later +Why I have not put example: too complicated -107)MapDataReader https://github.com/jitbit/MapDataReader +105)MapDataReader https://github.com/jitbit/MapDataReader Why I have not put example: old ISourceGenerator -108)MappingCloningExtensions https://github.com/musictopia2/MappingCloningExtensions +106)MappingCloningExtensions https://github.com/musictopia2/MappingCloningExtensions Why I have not put example: no readme -109)Maui.BindableProperty.Generator https://github.com/rrmanzano/maui-bindableproperty-generator +107)Maui.BindableProperty.Generator https://github.com/rrmanzano/maui-bindableproperty-generator Why I have not put example: later -110)MediatR https://github.com/Burgyn/MMLib.MediatR.Generators +108)MediatR https://github.com/Burgyn/MMLib.MediatR.Generators Why I have not put example: old ISourceGenerator -111)MemberAccessGenerator https://github.com/ufcpp/MemberAccessGenerator +109)MemberAccessGenerator https://github.com/ufcpp/MemberAccessGenerator Why I have not put example: old ISourceGenerator -112)MemoizeSourceGenerator https://github.com/Zoxive/MemoizeSourceGenerator +110)MemoizeSourceGenerator https://github.com/Zoxive/MemoizeSourceGenerator Why I have not put example: old ISourceGenerator -113)Minerals.AutoCQRS https://github.com/SzymonHalucha/Minerals.AutoCQRS +111)Minerals.AutoCQRS https://github.com/SzymonHalucha/Minerals.AutoCQRS Why I have not put example: later -114)Minerals.AutoDomain https://github.com/SzymonHalucha/Minerals.AutoDomain +112)Minerals.AutoDomain https://github.com/SzymonHalucha/Minerals.AutoDomain Why I have not put example: later -115)MiniRazor https://github.com/Tyrrrz/MiniRazor/ +113)MiniRazor https://github.com/Tyrrrz/MiniRazor/ Why I have not put example: archived -116)MockableStaticGenerator https://github.com/HamedFathi/MockableStaticGenerator +114)MockableStaticGenerator https://github.com/HamedFathi/MockableStaticGenerator Why I have not put example: old ISourceGenerator -117)MockGen https://github.com/thomas-girotto/MockGen +115)MockGen https://github.com/thomas-girotto/MockGen Why I have not put example: old ISourceGenerator -118)MockSourceGenerator https://github.com/hermanussen/MockSourceGenerator +116)MockSourceGenerator https://github.com/hermanussen/MockSourceGenerator Why I have not put example: old ISourceGenerator -119)MrMeeseeks.DIE https://github.com/Yeah69/MrMeeseeks.DIE +117)MrMeeseeks.DIE https://github.com/Yeah69/MrMeeseeks.DIE Why I have not put example: old ISourceGenerator -120)MrMeeseeks.ResXToViewModelGenerator https://github.com/Yeah69/MrMeeseeks.ResXToViewModelGenerator +118)MrMeeseeks.ResXToViewModelGenerator https://github.com/Yeah69/MrMeeseeks.ResXToViewModelGenerator Why I have not put example: old ISourceGenerator -121)MrMeeseeks.StaticDelegateGenerator https://github.com/Yeah69/MrMeeseeks.StaticDelegateGenerator +119)MrMeeseeks.StaticDelegateGenerator https://github.com/Yeah69/MrMeeseeks.StaticDelegateGenerator Why I have not put example: old ISourceGenerator -122)MrMeeseeks.Visitor https://github.com/Yeah69/MrMeeseeks.Visitor +120)MrMeeseeks.Visitor https://github.com/Yeah69/MrMeeseeks.Visitor Why I have not put example: old ISourceGenerator -123)MvvmGen https://github.com/thomasclaudiushuber/mvvmgen +121)MvvmGen https://github.com/thomasclaudiushuber/mvvmgen Why I have not put example: later -124)Neon.Roslyn https://www.nuget.org/packages/Neon.Roslyn +122)Neon.Roslyn https://www.nuget.org/packages/Neon.Roslyn Why I have not put example: old ISourceGenerator -125)net_automatic_interface https://github.com/codecentric/net_automatic_interface +123)net_automatic_interface https://github.com/codecentric/net_automatic_interface Why I have not put example: old ISourceGenerator -126)NSourceGenerators https://github.com/NeVeSpl/NSourceGenerators/ +124)NSourceGenerators https://github.com/NeVeSpl/NSourceGenerators/ Why I have not put example: old ISourceGenerator -127)observable https://github.com/notanaverageman/Bindables +125)observable https://github.com/notanaverageman/Bindables Why I have not put example: later -128)Overloader https://github.com/emptycoder/Overloader - -Why I have not put example: later - -129)Pipelines https://github.com/DumplingsDevs/Pipelines/ +126)Pipelines https://github.com/DumplingsDevs/Pipelines/ Why I have not put example: old ISourceGenerator -130)Plastic https://github.com/sang-hyeon/Plastic +127)Plastic https://github.com/sang-hyeon/Plastic Why I have not put example: old ISourceGenerator -131)PolySharp https://github.com/Sergio0694/PolySharp +128)PolySharp https://github.com/Sergio0694/PolySharp -Why I have not put example: later +Why I have not put example: too complicated -132)PrimaryConstructor https://github.com/chaowlert/PrimaryConstructor +129)PrimaryConstructor https://github.com/chaowlert/PrimaryConstructor Why I have not put example: old ISourceGenerator -133)PrimitiveStaticDataGenerator https://github.com/iiweis/PrimitiveStaticDataGenerator +130)PrimitiveStaticDataGenerator https://github.com/iiweis/PrimitiveStaticDataGenerator Why I have not put example: old ISourceGenerator -134)PrintMembersGenerator https://github.com/Youssef1313/PrintMembersGenerator +131)PrintMembersGenerator https://github.com/Youssef1313/PrintMembersGenerator Why I have not put example: old ISourceGenerator -135)ProxyInterfaceGenerator https://github.com/StefH/ProxyInterfaceSourceGenerator +132)ProxyInterfaceGenerator https://github.com/StefH/ProxyInterfaceSourceGenerator Why I have not put example: old ISourceGenerator -136)PureHDF https://github.com/Apollo3zehn/PureHDF +133)PureHDF https://github.com/Apollo3zehn/PureHDF Why I have not put example: old ISourceGenerator -137)RazorGen https://github.com/dartk/RazorGen +134)RazorGen https://github.com/dartk/RazorGen Why I have not put example: later -138)RazorPageRouteGenerator https://github.com/surgicalcoder/RazorPageRouteGenerator +135)RazorPageRouteGenerator https://github.com/surgicalcoder/RazorPageRouteGenerator Why I have not put example: old ISourceGenerator -139)ReForge.Union https://github.com/nalcorso/ReForge.Union +136)ReForge.Union https://github.com/nalcorso/ReForge.Union Why I have not put example: not having nuget, but having IIncrementalGenerator -140)RoslynWeave https://github.com/Jishun/RoslynWeave +137)RoslynWeave https://github.com/Jishun/RoslynWeave Why I have not put example: old ISourceGenerator -141)ScenarioTests https://github.com/koenbeuk/ScenarioTests +138)ScenarioTests https://github.com/koenbeuk/ScenarioTests Why I have not put example: old ISourceGenerator -142)SerdeDn https://github.com/serdedotnet/serde +139)SerdeDn https://github.com/serdedotnet/serde Why I have not put example: serializer. Done by MSFT with System.Text.Json -143)SmallSharp https://github.com/devlooped/SmallSharp +140)SmallSharp https://github.com/devlooped/SmallSharp Why I have not put example: old ISourceGenerator -144)SmartAnnotations https://github.com/fiseni/SmartAnnotations +141)SmartAnnotations https://github.com/fiseni/SmartAnnotations Why I have not put example: old ISourceGenerator -145)SogePoco https://github.com/d-p-y/SogePoco +142)SogePoco https://github.com/d-p-y/SogePoco -Why I have not put example: later +Why I have not put example: too complicated -146)SourceApi https://github.com/alekshura/SourceApi +143)SourceApi https://github.com/alekshura/SourceApi Why I have not put example: old ISourceGenerator -147)SourceConfig https://github.com/alekshura/SourceConfig +144)SourceConfig https://github.com/alekshura/SourceConfig Why I have not put example: old ISourceGenerator -148)SourceCrafter.HttpServiceClientGenerator https://github.com/pedro-gilmora/SourceCrafter.HttpServiceClientGenerator/ +145)SourceCrafter.HttpServiceClientGenerator https://github.com/pedro-gilmora/SourceCrafter.HttpServiceClientGenerator/ Why I have not put example: later -149)SourceGeneratorQuery https://github.com/roeibajayo/SourceGeneratorQuery +146)SourceGeneratorQuery https://github.com/roeibajayo/SourceGeneratorQuery Why I have not put example: old ISourceGenerator -150)SourceInject https://github.com/giggio/sourceinject/ +147)SourceInject https://github.com/giggio/sourceinject/ Why I have not put example: old ISourceGenerator -151)SourceMapper https://github.com/alekshura/SourceMapper +148)SourceMapper https://github.com/alekshura/SourceMapper Why I have not put example: old ISourceGenerator -152)SourceMapper https://github.com/paiden/SourceMapper/ +149)SourceMapper https://github.com/paiden/SourceMapper/ Why I have not put example: old ISourceGenerator -153)SqlMarshal https://github.com/kant2002/SqlMarshal +150)SqlMarshal https://github.com/kant2002/SqlMarshal Why I have not put example: old ISourceGenerator -154)ST.NSwag.ServerSourceGenerator https://github.com/s-tarasov/ST.NSwag.ServerSourceGenerator +151)ST.NSwag.ServerSourceGenerator https://github.com/s-tarasov/ST.NSwag.ServerSourceGenerator Why I have not put example: later -155)StackXML https://github.com/ZingBallyhoo/StackXML +152)StackXML https://github.com/ZingBallyhoo/StackXML Why I have not put example: old ISourceGenerator -156)StaticProxyGenerator https://github.com/robertturner/StaticProxyGenerator +153)StaticProxyGenerator https://github.com/robertturner/StaticProxyGenerator Why I have not put example: old ISourceGenerator -157)StrongInject https://github.com/YairHalberstadt/stronginject/ +154)StrongInject https://github.com/YairHalberstadt/stronginject/ Why I have not put example: later -158)StronglyTypedEmbeddedResources https://github.com/surgicalcoder/StronglyTypedEmbeddedResources +155)StronglyTypedEmbeddedResources https://github.com/surgicalcoder/StronglyTypedEmbeddedResources Why I have not put example: old ISourceGenerator -159)StructPacker https://github.com/RudolfKurka/StructPacker +156)StructPacker https://github.com/RudolfKurka/StructPacker Why I have not put example: old ISourceGenerator -160)Svg https://github.com/wieslawsoltes/Svg.Skia +157)Svg https://github.com/wieslawsoltes/Svg.Skia Why I have not put example: old ISourceGenerator -161)tecli https://github.com/tyevco/TeCLI +158)tecli https://github.com/tyevco/TeCLI Why I have not put example: old ISourceGenerator -162)TeuJson https://github.com/Terria-K/TeuJson +159)TeuJson https://github.com/Terria-K/TeuJson Why I have not put example: json a class, was done in System.Text.Json -163)Thunderboltloc https://github.com/AlyElhaddad/ThunderboltIoc +160)Thunderboltloc https://github.com/AlyElhaddad/ThunderboltIoc Why I have not put example: old ISourceGenerator -164)Tinyhand https://github.com/archi-Doc/Tinyhand +161)Tinyhand https://github.com/archi-Doc/Tinyhand Why I have not put example: tried, need documentation -165)ToString https://github.com/Burgyn/MMLib.ToString +162)ToString https://github.com/Burgyn/MMLib.ToString Why I have not put example: old ISourceGenerator -166)Transplator https://github.com/atifaziz/Transplator +163)Transplator https://github.com/atifaziz/Transplator Why I have not put example: old ISourceGenerator -167)TupleOverloadGenerator https://github.com/ProphetLamb/TupleOverloadGenerator +164)TupleOverloadGenerator https://github.com/ProphetLamb/TupleOverloadGenerator -Why I have not put example: later +Why I have not put example: too complicated -168)TxtToListGenerator https://github.com/musictopia2/TxtToListGenerator +165)TxtToListGenerator https://github.com/musictopia2/TxtToListGenerator Why I have not put example: no readme -169)TypealizR https://github.com/earloc/TypealizR +166)TypealizR https://github.com/earloc/TypealizR Why I have not put example: depends on Microsoft.Extensions.Localization -170)UnitTestBlazor https://github.com/bUnit-dev/bUnit +167)UnitTestBlazor https://github.com/bUnit-dev/bUnit Why I have not put example: issue opened -171)ValueChangedGenerator https://github.com/ufcpp/ValueChangedGenerator +168)ValueChangedGenerator https://github.com/ufcpp/ValueChangedGenerator Why I have not put example: old ISourceGenerator -172)ValueLink https://github.com/archi-Doc/ValueLink +169)ValueLink https://github.com/archi-Doc/ValueLink -Why I have not put example: later +Why I have not put example: too complicated -173)ValueObjectGenerator https://github.com/RyotaMurohoshi/ValueObjectGenerator +170)ValueObjectGenerator https://github.com/RyotaMurohoshi/ValueObjectGenerator Why I have not put example: old ISourceGenerator -174)VisitorPatternGenerator https://github.com/hikarin522/VisitorPatternGenerator/ +171)VisitorPatternGenerator https://github.com/hikarin522/VisitorPatternGenerator/ Why I have not put example: issue opened -175)Visor https://github.com/Tinkoff/Visor +172)Visor https://github.com/Tinkoff/Visor -Why I have not put example: later +Why I have not put example: archived -176)WrapperValueObject https://github.com/martinothamar/WrapperValueObject +173)WrapperValueObject https://github.com/martinothamar/WrapperValueObject Why I have not put example: not maintained as in readme -177)Xtz.StronglyTyped https://github.com/dev-experience/Xtz.StronglyTyped +174)Xtz.StronglyTyped https://github.com/dev-experience/Xtz.StronglyTyped Why I have not put example: old ISourceGenerator diff --git a/v2/rscg_examples_site/docs/RSCG-Examples/FactoryGenerator.Abstractions.md b/v2/rscg_examples_site/docs/RSCG-Examples/FactoryGenerator.Abstractions.md index bd7328732..e1de92444 100644 --- a/v2/rscg_examples_site/docs/RSCG-Examples/FactoryGenerator.Abstractions.md +++ b/v2/rscg_examples_site/docs/RSCG-Examples/FactoryGenerator.Abstractions.md @@ -237,7 +237,6 @@ public class Customer : Person ### Generated Files Those are taken from $(BaseIntermediateOutputPath)\GX - @@ -289,7 +288,6 @@ public sealed class PersonTypePersonFactoryFactory : FactoryGenerator.Abstractio - ## Useful ### Download Example (.NET C#) diff --git a/v2/rscg_examples_site/docs/RSCG-Examples/JinShil.MixinSourceGenerator.md b/v2/rscg_examples_site/docs/RSCG-Examples/JinShil.MixinSourceGenerator.md index 7c11c0ef9..5bee41d0b 100644 --- a/v2/rscg_examples_site/docs/RSCG-Examples/JinShil.MixinSourceGenerator.md +++ b/v2/rscg_examples_site/docs/RSCG-Examples/JinShil.MixinSourceGenerator.md @@ -319,7 +319,6 @@ internal class LogData ### Generated Files Those are taken from $(BaseIntermediateOutputPath)\GX - @@ -379,7 +378,6 @@ namespace DemoMixin - ## Useful ### Download Example (.NET C#) diff --git a/v2/rscg_examples_site/docs/RSCG-Examples/Schema.md b/v2/rscg_examples_site/docs/RSCG-Examples/Schema.md index dc9129d5c..3fded74e6 100644 --- a/v2/rscg_examples_site/docs/RSCG-Examples/Schema.md +++ b/v2/rscg_examples_site/docs/RSCG-Examples/Schema.md @@ -419,7 +419,6 @@ public partial class Person : IBinaryConvertible ### Generated Files Those are taken from $(BaseIntermediateOutputPath)\GX - @@ -1380,7 +1379,6 @@ public partial class Person { - ## Useful ### Download Example (.NET C#) diff --git a/v2/rscg_examples_site/docs/RSCG-Examples/index.md b/v2/rscg_examples_site/docs/RSCG-Examples/index.md index 8eece553b..215d09adb 100644 --- a/v2/rscg_examples_site/docs/RSCG-Examples/index.md +++ b/v2/rscg_examples_site/docs/RSCG-Examples/index.md @@ -1,7 +1,7 @@ --- sidebar_position: 30 -title: 225 RSCG list by category -description: 225 RSCG list by category +title: 226 RSCG list by category +description: 226 RSCG list by category slug: /rscg-examples --- @@ -689,7 +689,7 @@ import DocCardList from '@theme/DocCardList'; ## Enum
- Expand Enum =>examples:10 + Expand Enum =>examples:11 @@ -740,6 +740,11 @@ import DocCardList from '@theme/DocCardList'; [EnumsEnhanced](/docs/EnumsEnhanced) + + + +[requiredenum](/docs/requiredenum) +
@@ -1653,6 +1658,8 @@ flowchart LR; Enum--> EnumsEnhanced((EnumsEnhanced)) + Enum--> requiredenum((requiredenum)) + Equals--> GeneratorEquals((GeneratorEquals)) Equals--> Equatable.Generator((Equatable.Generator)) diff --git a/v2/rscg_examples_site/docs/RSCG-Examples/requiredenum.md b/v2/rscg_examples_site/docs/RSCG-Examples/requiredenum.md new file mode 100644 index 000000000..691a34622 --- /dev/null +++ b/v2/rscg_examples_site/docs/RSCG-Examples/requiredenum.md @@ -0,0 +1,218 @@ +--- +sidebar_position: 2260 +title: 226 - requiredenum +description: Raise an error at compile time if not have switch handle case all enums values +slug: /requiredenum +--- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; +import TOCInline from '@theme/TOCInline'; +import SameCategory from '../Categories/_PrimitiveEnum.mdx'; + +# requiredenum by Yaroslav + + + + +## NuGet / site data +[![Nuget](https://img.shields.io/nuget/dt/requiredenum?label=requiredenum)](https://www.nuget.org/packages/requiredenum/) +[![GitHub last commit](https://img.shields.io/github/last-commit/emptycoder/RequiredEnum?label=updated)](https://github.com/emptycoder/RequiredEnum) +![GitHub Repo stars](https://img.shields.io/github/stars/emptycoder/RequiredEnum?style=social) + +## Details + +### Info +:::info + +Name: **requiredenum** + +RequiredEnum is an open-source analyzer that helps handle all enum values for switch. + +Author: Yaroslav + +NuGet: +*https://www.nuget.org/packages/requiredenum/* + + +You can find more details at https://github.com/emptycoder/RequiredEnum + +Source: https://github.com/emptycoder/RequiredEnum + +::: + +### Author +:::note +Yaroslav +![Alt text](https://github.com/emptycoder.png) +::: + +### Original Readme +:::note + +

RequiredEnum

+ +RequiredEnum is an open-source analyzer that helps handle all enum values for switch. + +# Installation + +[NuGet](https://www.nuget.org/packages/RequiredEnum/): `dotnet add package requiredenum` + +# Usage + +Just add 'Required' prefix for any name of enum in your project and you will get the error when one of cases weren't handle in a switch statement. + +```csharp +var test = (RequiredNumbers) Random.Shared.Next(0, Enum.GetNames(typeof(RequiredNumbers)).Length); +switch (test) +{ + case RequiredNumbers.Zero: + break; + case RequiredNumbers.One: + break; + default: + throw new ArgumentOutOfRangeException(); +} + +internal enum RequiredNumbers +{ + Zero, + One, + Two +} +``` +This code will throw the error ('Two' case wasn't handle) and it can't be compiled. + +# License + +RequiredEnum distributed under [MIT](https://github.com/emptycoder/RequiredEnum/LICENSE) license. + + +::: + +### About +:::note + +Raise an error at compile time if not have switch handle case all enums values + + +::: + +## How to use + +### Example (source csproj, source files) + + + + + +This is the CSharp Project that references **requiredenum** +```xml showLineNumbers {16} + + + + Exe + net9.0 + enable + enable + + + + true + $(BaseIntermediateOutputPath)\GX + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + +``` + + + + + + This is the use of **requiredenum** in *Program.cs* + +```csharp showLineNumbers +// See https://aka.ms/new-console-template for more information +using EnumDemo; + +Console.WriteLine("Hello, World!"); +RequiredCarTypes myCar = RequiredCarTypes.Tesla; +switch(myCar) +{ + //comment any case to see the error in action + case RequiredCarTypes.None: + Console.WriteLine("No car"); + break; + case RequiredCarTypes.Dacia: + Console.WriteLine("Dacia"); + break; + case RequiredCarTypes.Tesla: + Console.WriteLine("Tesla"); + break; + case RequiredCarTypes.BMW: + Console.WriteLine("BMW"); + break; + case RequiredCarTypes.Mercedes: + Console.WriteLine("Mercedes"); + break; + default: + Console.WriteLine("Unknown car"); + break; +} +``` + + + + + This is the use of **requiredenum** in *RequiredCarTypes.cs* + +```csharp showLineNumbers + +namespace EnumDemo; +public enum RequiredCarTypes +{ + None, + Dacia , + Tesla , + BMW , + Mercedes , +} + +``` + + + + +### Generated Files +## Useful + +### Download Example (.NET C#) + +:::tip + +[Download Example project requiredenum ](/sources/requiredenum.zip) + +::: + + +### Share requiredenum + + + +https://ignatandrei.github.io/RSCG_Examples/v2/docs/requiredenum + + + diff --git a/v2/rscg_examples_site/docs/about.md b/v2/rscg_examples_site/docs/about.md index 9e6b21a19..24f975d87 100644 --- a/v2/rscg_examples_site/docs/about.md +++ b/v2/rscg_examples_site/docs/about.md @@ -6,7 +6,7 @@ title: About ## Content You will find here code examples -of 225 Roslyn Source Code Generator (RSCG) +of 226 Roslyn Source Code Generator (RSCG) that can be useful for you. That means, you will write more elegant and concise code - even if the generators code is not always nice to look. ## Are those examples ready for production? diff --git a/v2/rscg_examples_site/docs/indexRSCG.md b/v2/rscg_examples_site/docs/indexRSCG.md index fe04e3000..0852a827e 100644 --- a/v2/rscg_examples_site/docs/indexRSCG.md +++ b/v2/rscg_examples_site/docs/indexRSCG.md @@ -7,9 +7,9 @@ slug: /List-of-RSCG import useBaseUrl from '@docusaurus/useBaseUrl'; -## 225 RSCG with examples in descending chronological order +## 226 RSCG with examples in descending chronological order -This is the list of 225 ( 14 from Microsoft) RSCG with examples +This is the list of 226 ( 14 from Microsoft) RSCG with examples [See by category](/docs/rscg-examples) [See as json](/exports/RSCG.json) [See as Excel](/exports/RSCG.xlsx) @@ -20,6 +20,7 @@ This is the list of 225 ( 14 from Microsoft) RSCG with examples | No | Name | Date | Category | | --------- | ----- | ---- | -------- | +|226| [requiredenum by Yaroslav ](/docs/requiredenum)|2025-08-14 => 14 August 2025 | [Enum](/docs/Categories/Enum) | |225| [Schema by Melty Player ](/docs/Schema)|2025-08-13 => 13 August 2025 | [Serializer](/docs/Categories/Serializer) | |224| [FactoryGenerator.Abstractions by Ivan Mazurenko ](/docs/FactoryGenerator.Abstractions)|2025-08-12 => 12 August 2025 | [DependencyInjection](/docs/Categories/DependencyInjection) | |223| [JinShil.MixinSourceGenerator by Jin Shil ](/docs/JinShil.MixinSourceGenerator)|2025-08-11 => 11 August 2025 | [Mixin](/docs/Categories/Mixin) | diff --git a/v2/rscg_examples_site/src/components/HomepageFeatures/index.js b/v2/rscg_examples_site/src/components/HomepageFeatures/index.js index ef1831458..30c485b5f 100644 --- a/v2/rscg_examples_site/src/components/HomepageFeatures/index.js +++ b/v2/rscg_examples_site/src/components/HomepageFeatures/index.js @@ -4,7 +4,7 @@ import styles from './styles.module.css'; const FeatureList = [ { -title: '225 Examples (14 from MSFT)', +title: '226 Examples (14 from MSFT)', Svg: require('@site/static/img/undraw_docusaurus_mountain.svg').default, description: ( <> diff --git a/v2/rscg_examples_site/static/exports/RSCG.json b/v2/rscg_examples_site/static/exports/RSCG.json index f33fa0dfa..6a77683bb 100644 --- a/v2/rscg_examples_site/static/exports/RSCG.json +++ b/v2/rscg_examples_site/static/exports/RSCG.json @@ -1801,6 +1801,14 @@ "Source": "https://github.com/MeltyPlayer/Schema", "Category": "Serializer", "AddedOn": "2025-08-13T00:00:00" + }, + { + "Name": "requiredenum", + "Link": "https://ignatandrei.github.io/RSCG_Examples/v2/docs/requiredenum", + "NuGet": "https://www.nuget.org/packages/requiredenum/", + "Source": "https://github.com/emptycoder/RequiredEnum", + "Category": "Enum", + "AddedOn": "2025-08-14T00:00:00" } ] } \ No newline at end of file diff --git a/v2/rscg_examples_site/static/exports/RSCG.xlsx b/v2/rscg_examples_site/static/exports/RSCG.xlsx index a7403a231..0746547d4 100644 Binary files a/v2/rscg_examples_site/static/exports/RSCG.xlsx and b/v2/rscg_examples_site/static/exports/RSCG.xlsx differ diff --git a/v2/rscg_examples_site/static/sources/requiredenum.zip b/v2/rscg_examples_site/static/sources/requiredenum.zip new file mode 100644 index 000000000..9c66c1ecb Binary files /dev/null and b/v2/rscg_examples_site/static/sources/requiredenum.zip differ