diff --git a/README.md b/README.md index 86a87e4e2..5af178447 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ -# RSCG - 235 Examples of Roslyn Source Code Generators / 14 created by Microsoft / +# RSCG - 236 Examples of Roslyn Source Code Generators / 14 created by Microsoft / -The RSCG_Examples repository is a comprehensive documentation system that automatically processes and showcases 235 Roslyn Source Code Generator (RSCG) examples. The system transforms individual RSCG projects into structured documentation with code examples and cross-referenced content with a searchable website and code example exports. +The RSCG_Examples repository is a comprehensive documentation system that automatically processes and showcases 236 Roslyn Source Code Generator (RSCG) examples. The system transforms individual RSCG projects into structured documentation with code examples and cross-referenced content with a searchable website and code example exports. This system serves as both a learning resource for .NET developers interested in source generators and an automated pipeline for maintaining up-to-date documentation about the RSCG ecosystem -## Latest Update : 2025-10-05 => 05 October 2025 +## Latest Update : 2025-10-06 => 06 October 2025 If you want to see examples with code, please click ***[List V2](https://ignatandrei.github.io/RSCG_Examples/v2/docs/List-of-RSCG)*** @@ -12,7 +12,7 @@ If you want just those from Microsoft, please click ***[Microsoft](https://ignat If you want to see by category, please click ***[category](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples)*** or click any category below -[actor](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#actor) -[ai](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#ai) -[aop](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#aop) -[api](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#api) -[async](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#async) -[bitwise](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#bitwise) -[blazor](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#blazor) -[builder](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#builder) -[clone](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#clone) -[codetostring](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#codetostring) -[commandline](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#commandline) -[console](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#console) -[constructor](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#constructor) -[database](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#database) -[dependencyinjection](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#dependencyinjection) -[disposer](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#disposer) -[enhancementclass](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#enhancementclass) -[enhancementproject](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#enhancementproject) -[enum](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#enum) -[equals](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#equals) -[filestocode](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#filestocode) -[functionalprogramming](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#functionalprogramming) -[hangfire](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#hangfire) -[interface](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#interface) -[linq](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#linq) -[mapper](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#mapper) -[mediator](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#mediator) -[mixin](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#mixin) -[mvc](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#mvc) -[mvvm](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#mvvm) -[optimizer](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#optimizer) -[primitiveobsession](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#primitiveobsession) -[rx](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#rx) -[serializer](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#serializer) -[signalr](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#signalr) -[statemachine](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#statemachine) -[templating](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#templating) -[tests](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#tests) -[winapi](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#winapi) - +[actor](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#actor) -[ai](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#ai) -[aop](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#aop) -[api](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#api) -[async](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#async) -[bitwise](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#bitwise) -[blazor](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#blazor) -[builder](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#builder) -[clone](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#clone) -[codetostring](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#codetostring) -[commandline](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#commandline) -[console](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#console) -[constructor](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#constructor) -[database](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#database) -[dependencyinjection](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#dependencyinjection) -[disposer](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#disposer) -[enhancementclass](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#enhancementclass) -[enhancementproject](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#enhancementproject) -[enum](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#enum) -[equals](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#equals) -[filestocode](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#filestocode) -[functionalprogramming](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#functionalprogramming) -[hangfire](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#hangfire) -[interface](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#interface) -[linq](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#linq) -[mapper](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#mapper) -[mediator](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#mediator) -[mixin](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#mixin) -[mvc](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#mvc) -[mvvm](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#mvvm) -[optimizer](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#optimizer) -[primitiveobsession](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#primitiveobsession) -[rx](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#rx) -[serializer](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#serializer) -[signalr](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#signalr) -[statemachine](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#statemachine) -[templating](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#templating) -[tests](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#tests) -[validator](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#validator) -[winapi](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#winapi) - ## If you have a Roslyn Source Code Generator, please create an issue. @@ -24,8 +24,30 @@ If you want to be notified each time I add a new RSCG example , please click htt ## Content -Those are the 235 Roslyn Source Code Generators that I have tested you can see and download source code example. +Those are the 236 Roslyn Source Code Generators that I have tested you can see and download source code example. ( including 14 from Microsoft ) +### 236. [validly](https://ignatandrei.github.io/RSCG_Examples/v2/docs/validly) , in the [Validator](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#validator) category + +Generated on : 2025-10-06 => 06 October 2025 + +
+ Expand + + + +Author: Roman Jambor + +Powerful, efficient, and highly customizable validation library for .NET, leveraging the capabilities of C# Source Generators to provide compile-time validation logic generation. + +Nuget: [https://www.nuget.org/packages/validly/](https://www.nuget.org/packages/validly/) + + +Link: [https://ignatandrei.github.io/RSCG_Examples/v2/docs/validly](https://ignatandrei.github.io/RSCG_Examples/v2/docs/validly) + +Source: [https://github.com/Hookyns/validly](https://github.com/Hookyns/validly) + +
+ ### 235. [Csvcsharp](https://ignatandrei.github.io/RSCG_Examples/v2/docs/Csvcsharp) , in the [Serializer](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#serializer) category Generated on : 2025-10-05 => 05 October 2025 @@ -5554,266 +5576,252 @@ 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 -28) [https://github.com/Hookyns/validly]( https://github.com/Hookyns/validly) , https://github.com/Hookyns/validly - -Why I have not tested : later - -https://github.com/ignatandrei/RSCG_Examples/issues/new?title=https://github.com/Hookyns/validly&body=https://github.com/Hookyns/validly - - -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 : 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 : own idea where to generate files, so overwrites 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 : 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/nuskey8/Csv-CSharp]( https://github.com/nuskey8/Csv-CSharp) , https://github.com/nuskey8/Csv-CSharp - -Why I have not tested : later - -https://github.com/ignatandrei/RSCG_Examples/issues/new?title=https://github.com/nuskey8/Csv-CSharp&body=https://github.com/nuskey8/Csv-CSharp - - -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/pierre3/PlantUmlClassDiagramGenerator]( https://github.com/pierre3/PlantUmlClassDiagramGenerator) , https://github.com/pierre3/PlantUmlClassDiagramGenerator +32) [https://github.com/pierre3/PlantUmlClassDiagramGenerator]( https://github.com/pierre3/PlantUmlClassDiagramGenerator) , https://github.com/pierre3/PlantUmlClassDiagramGenerator Why I have not tested : later https://github.com/ignatandrei/RSCG_Examples/issues/new?title=https://github.com/pierre3/PlantUmlClassDiagramGenerator&body=https://github.com/pierre3/PlantUmlClassDiagramGenerator -35) [https://github.com/stbychkov/AutoLoggerMessage]( https://github.com/stbychkov/AutoLoggerMessage) , https://github.com/stbychkov/AutoLoggerMessage +33) [https://github.com/stbychkov/AutoLoggerMessage]( https://github.com/stbychkov/AutoLoggerMessage) , https://github.com/stbychkov/AutoLoggerMessage 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 -36) [https://github.com/Stepami/visitor-net]( https://github.com/Stepami/visitor-net) , https://github.com/Stepami/visitor-net +34) [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 -37) [https://github.com/svee4/RequiredStaticMembers]( https://github.com/svee4/RequiredStaticMembers) , https://github.com/svee4/RequiredStaticMembers +35) [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 -38) [https://github.com/SzymonHalucha/Minerals.AutoCommands]( https://github.com/SzymonHalucha/Minerals.AutoCommands) , https://github.com/SzymonHalucha/Minerals.AutoCommands +36) [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 -39) [https://github.com/Teleopti/Saspect]( https://github.com/Teleopti/Saspect) , https://github.com/Teleopti/Saspect +37) [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 -40) [https://github.com/TheFo2sh/AsyncFlow]( https://github.com/TheFo2sh/AsyncFlow) , https://github.com/TheFo2sh/AsyncFlow +38) [https://github.com/TheFo2sh/AsyncFlow]( https://github.com/TheFo2sh/AsyncFlow) , https://github.com/TheFo2sh/AsyncFlow 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 -41) [https://github.com/wieslawsoltes/ReactiveGenerator]( https://github.com/wieslawsoltes/ReactiveGenerator) , https://github.com/wieslawsoltes/ReactiveGenerator +39) [https://github.com/wieslawsoltes/ReactiveGenerator]( https://github.com/wieslawsoltes/ReactiveGenerator) , https://github.com/wieslawsoltes/ReactiveGenerator 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 -42) [Intellenum]( https://github.com/SteveDunn/Intellenum) , https://github.com/SteveDunn/Intellenum +40) [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 -43) [laker]( https://github.com/Lakerfield/Lakerfield.Rpc) , https://github.com/Lakerfield/Lakerfield.Rpc +41) [laker]( https://github.com/Lakerfield/Lakerfield.Rpc) , https://github.com/Lakerfield/Lakerfield.Rpc Why I have not tested : too complicated https://github.com/ignatandrei/RSCG_Examples/issues/new?title=laker&body=https://github.com/Lakerfield/Lakerfield.Rpc -44) [LoggingDecoratorGenerator]( https://github.com/DavidFineboym/LoggingDecoratorGenerator) , https://github.com/DavidFineboym/LoggingDecoratorGenerator +42) [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 -45) [lucide-blazor]( https://github.com/brecht-vde/lucide-blazor/) , https://github.com/brecht-vde/lucide-blazor/ +43) [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/ -46) [ManagedDotnetProfiler]( https://github.com/kevingosse/ManagedDotnetProfiler) , https://github.com/kevingosse/ManagedDotnetProfiler +44) [ManagedDotnetProfiler]( https://github.com/kevingosse/ManagedDotnetProfiler) , https://github.com/kevingosse/ManagedDotnetProfiler Why I have not tested : too complicated https://github.com/ignatandrei/RSCG_Examples/issues/new?title=ManagedDotnetProfiler&body=https://github.com/kevingosse/ManagedDotnetProfiler -47) [Maui.BindableProperty.Generator]( https://github.com/rrmanzano/maui-bindableproperty-generator) , https://github.com/rrmanzano/maui-bindableproperty-generator +45) [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 -48) [Minerals.AutoCQRS]( https://github.com/SzymonHalucha/Minerals.AutoCQRS) , https://github.com/SzymonHalucha/Minerals.AutoCQRS +46) [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 -49) [Minerals.AutoDomain]( https://github.com/SzymonHalucha/Minerals.AutoDomain) , https://github.com/SzymonHalucha/Minerals.AutoDomain +47) [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 -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) [PolySharp]( https://github.com/Sergio0694/PolySharp) , https://github.com/Sergio0694/PolySharp +49) [PolySharp]( https://github.com/Sergio0694/PolySharp) , https://github.com/Sergio0694/PolySharp Why I have not tested : too complicated https://github.com/ignatandrei/RSCG_Examples/issues/new?title=PolySharp&body=https://github.com/Sergio0694/PolySharp -52) [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 -53) [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 -54) [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 : too complicated https://github.com/ignatandrei/RSCG_Examples/issues/new?title=SogePoco&body=https://github.com/d-p-y/SogePoco -55) [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/ -56) [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 -57) [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/ -58) [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 -59) [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 -60) [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 : too complicated https://github.com/ignatandrei/RSCG_Examples/issues/new?title=TupleOverloadGenerator&body=https://github.com/ProphetLamb/TupleOverloadGenerator -61) [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 -62) [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 -63) [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 : too complicated https://github.com/ignatandrei/RSCG_Examples/issues/new?title=ValueLink&body=https://github.com/archi-Doc/ValueLink -64) [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/ -65) [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 diff --git a/later.md b/later.md index 6835fb263..82ca010ca 100644 --- a/later.md +++ b/later.md @@ -1,6 +1,6 @@ # Just later -## Latest Update : 2025-10-05 => 05 October 2025 +## Latest Update : 2025-10-06 => 06 October 2025 @@ -62,85 +62,73 @@ Why I have not tested : later -10) [https://github.com/Hookyns/validly]( https://github.com/Hookyns/validly) , https://github.com/Hookyns/validly +10) [https://github.com/pierre3/PlantUmlClassDiagramGenerator]( https://github.com/pierre3/PlantUmlClassDiagramGenerator) , https://github.com/pierre3/PlantUmlClassDiagramGenerator Why I have not tested : later -11) [https://github.com/nuskey8/Csv-CSharp]( https://github.com/nuskey8/Csv-CSharp) , https://github.com/nuskey8/Csv-CSharp +11) [https://github.com/Stepami/visitor-net]( https://github.com/Stepami/visitor-net) , https://github.com/Stepami/visitor-net Why I have not tested : later -12) [https://github.com/pierre3/PlantUmlClassDiagramGenerator]( https://github.com/pierre3/PlantUmlClassDiagramGenerator) , https://github.com/pierre3/PlantUmlClassDiagramGenerator +12) [https://github.com/SzymonHalucha/Minerals.AutoCommands]( https://github.com/SzymonHalucha/Minerals.AutoCommands) , https://github.com/SzymonHalucha/Minerals.AutoCommands Why I have not tested : later -13) [https://github.com/Stepami/visitor-net]( https://github.com/Stepami/visitor-net) , https://github.com/Stepami/visitor-net +13) [https://github.com/Teleopti/Saspect]( https://github.com/Teleopti/Saspect) , https://github.com/Teleopti/Saspect Why I have not tested : later -14) [https://github.com/SzymonHalucha/Minerals.AutoCommands]( https://github.com/SzymonHalucha/Minerals.AutoCommands) , https://github.com/SzymonHalucha/Minerals.AutoCommands +14) [Maui.BindableProperty.Generator]( https://github.com/rrmanzano/maui-bindableproperty-generator) , https://github.com/rrmanzano/maui-bindableproperty-generator Why I have not tested : later -15) [https://github.com/Teleopti/Saspect]( https://github.com/Teleopti/Saspect) , https://github.com/Teleopti/Saspect +15) [Minerals.AutoCQRS]( https://github.com/SzymonHalucha/Minerals.AutoCQRS) , https://github.com/SzymonHalucha/Minerals.AutoCQRS Why I have not tested : later -16) [Maui.BindableProperty.Generator]( https://github.com/rrmanzano/maui-bindableproperty-generator) , https://github.com/rrmanzano/maui-bindableproperty-generator +16) [Minerals.AutoDomain]( https://github.com/SzymonHalucha/Minerals.AutoDomain) , https://github.com/SzymonHalucha/Minerals.AutoDomain Why I have not tested : later -17) [Minerals.AutoCQRS]( https://github.com/SzymonHalucha/Minerals.AutoCQRS) , https://github.com/SzymonHalucha/Minerals.AutoCQRS +17) [observable]( https://github.com/notanaverageman/Bindables) , https://github.com/notanaverageman/Bindables Why I have not tested : later -18) [Minerals.AutoDomain]( https://github.com/SzymonHalucha/Minerals.AutoDomain) , https://github.com/SzymonHalucha/Minerals.AutoDomain +18) [RazorGen]( https://github.com/dartk/RazorGen) , https://github.com/dartk/RazorGen Why I have not tested : later -19) [observable]( https://github.com/notanaverageman/Bindables) , https://github.com/notanaverageman/Bindables +19) [SourceCrafter.HttpServiceClientGenerator]( https://github.com/pedro-gilmora/SourceCrafter.HttpServiceClientGenerator/) , https://github.com/pedro-gilmora/SourceCrafter.HttpServiceClientGenerator/ Why I have not tested : later -20) [RazorGen]( https://github.com/dartk/RazorGen) , https://github.com/dartk/RazorGen +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) [SourceCrafter.HttpServiceClientGenerator]( https://github.com/pedro-gilmora/SourceCrafter.HttpServiceClientGenerator/) , https://github.com/pedro-gilmora/SourceCrafter.HttpServiceClientGenerator/ - -Why I have not tested : later - - - -22) [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 - - - -23) [StrongInject]( https://github.com/YairHalberstadt/stronginject/) , https://github.com/YairHalberstadt/stronginject/ +21) [StrongInject]( https://github.com/YairHalberstadt/stronginject/) , https://github.com/YairHalberstadt/stronginject/ Why I have not tested : later diff --git a/v2/Generator/all.csv b/v2/Generator/all.csv index 1e2817f31..f6c21bd05 100644 --- a/v2/Generator/all.csv +++ b/v2/Generator/all.csv @@ -234,3 +234,4 @@ Nr,Key,Source,Category 233,Vyaml, https://github.com/hadashiA/VYaml,Serializer 234,RapidEnum, https://github.com/hanachiru/RapidEnum,Enum 235,CsvCsharp, https://github.com/nuskey8/Csv-CSharp,Serializer +236,Validly, https://github.com/Hookyns/validly,Validator diff --git a/v2/GeneratorData/Category.cs b/v2/GeneratorData/Category.cs index 284e89b23..197fc23a9 100644 --- a/v2/GeneratorData/Category.cs +++ b/v2/GeneratorData/Category.cs @@ -42,5 +42,6 @@ public enum Category AI=37, RX=38, Mixin=39, + Validator=40, } diff --git a/v2/RSCGExamplesData/GeneratorDataRec.json b/v2/RSCGExamplesData/GeneratorDataRec.json index cd33c9e69..966364e10 100644 --- a/v2/RSCGExamplesData/GeneratorDataRec.json +++ b/v2/RSCGExamplesData/GeneratorDataRec.json @@ -1421,5 +1421,12 @@ "Category":16, "dtStart": "2025-10-05T00:00:00", "show": true +}, + +{ + "ID":"Validly", + "Category":40, + "dtStart": "2025-10-06T00:00:00", + "show": true } ] \ No newline at end of file diff --git a/v2/RSCGExamplesData/NoExample.json b/v2/RSCGExamplesData/NoExample.json index ef4feb993..f03c0faa4 100644 --- a/v2/RSCGExamplesData/NoExample.json +++ b/v2/RSCGExamplesData/NoExample.json @@ -876,16 +876,6 @@ "name":"https://github.com/pierre3/PlantUmlClassDiagramGenerator", "why":"later" }, - { - "ID":226, - "name":"https://github.com/Hookyns/validly", - "why":"later" - }, - { - "ID":228, - "name":"https://github.com/nuskey8/Csv-CSharp", - "why":"later" - }, { "ID":230, "name":"https://github.com/FoundatioFx/Foundatio.Mediator", diff --git a/v2/book/examples/validly.html b/v2/book/examples/validly.html new file mode 100644 index 000000000..994a4dba3 --- /dev/null +++ b/v2/book/examples/validly.html @@ -0,0 +1,59 @@ + +

RSCG nr 236 : validly

+ +

Info

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

You can find more details at : https://github.com/Hookyns/validly

+ +

Author :Roman Jambor

+ +

Source: https://github.com/Hookyns/validly

+ +

About

+ +Generates validation code for C# classes based on attributes. + +

+ How to use +

+

+ Add reference to the validly in the csproj +

+ + +

This was for me the starting code

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

And here are the generated files

+ +
+ The file generated is Person.Validator.g.cs +
+ + +

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

+ + +

+ 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 fa1d0a1b8..4a581852e 100644 --- a/v2/book/list.html +++ b/v2/book/list.html @@ -17,7 +17,7 @@

-This is the list of 235 RSCG with examples => +This is the list of 236 RSCG with examples =>

@@ -966,6 +966,10 @@

+ + + +
235 Csvcsharp
236validly
diff --git a/v2/book/pandocHTML.yaml b/v2/book/pandocHTML.yaml index 821208e52..181cc65b1 100644 --- a/v2/book/pandocHTML.yaml +++ b/v2/book/pandocHTML.yaml @@ -249,6 +249,7 @@ input-files: - examples/VYaml.html - examples/RapidEnum.html - examples/Csvcsharp.html +- examples/validly.html # or you may use input-file: with a single value # defaults: diff --git a/v2/rscg_examples/validly/description.json b/v2/rscg_examples/validly/description.json new file mode 100644 index 000000000..e3ad47702 --- /dev/null +++ b/v2/rscg_examples/validly/description.json @@ -0,0 +1,22 @@ +{ + "generator":{ + "name":"validly", + "nuget":[ + "https://www.nuget.org/packages/validly/" + ], + "link":"https://github.com/Hookyns/validly", + "author":"Roman Jambor", + "source":"https://github.com/Hookyns/validly" + }, + "data":{ + "goodFor":["Generates validation code for C# classes based on attributes."], + "csprojDemo":"valid.csproj", + "csFiles":["Program.cs","Person.cs"], + "excludeDirectoryGenerated":[""], + "includeAdditionalFiles":[""] + }, + "links":{ + "blog":"", + "video":"" + } +} \ No newline at end of file diff --git a/v2/rscg_examples/validly/nuget.txt b/v2/rscg_examples/validly/nuget.txt new file mode 100644 index 000000000..b1d6b8605 --- /dev/null +++ b/v2/rscg_examples/validly/nuget.txt @@ -0,0 +1 @@ +Powerful, efficient, and highly customizable validation library for .NET, leveraging the capabilities of C# Source Generators to provide compile-time validation logic generation. \ No newline at end of file diff --git a/v2/rscg_examples/validly/readme.txt b/v2/rscg_examples/validly/readme.txt new file mode 100644 index 000000000..8c9ad7063 --- /dev/null +++ b/v2/rscg_examples/validly/readme.txt @@ -0,0 +1,121 @@ +# Validly + +[![NuGet](https://img.shields.io/nuget/v/Validly)](https://www.nuget.org/packages/Validly) +[![License MIT](https://img.shields.io/badge/License-MIT-brightgreen?style=flat-square)](https://opensource.org/licenses/MIT) +[![Support Ukraine](https://img.shields.io/badge/Support-Ukraine-FFDD00?labelColor=0057B7)](https://donate.redcross.org.uk/appeal/ukraine-crisis-appeal) +[![All Contributors](https://img.shields.io/badge/all_contributors-5-orange.svg?style=flat-square)](#contributors-) + + +This repository contains a powerful, efficient, and highly customizable validation library for .NET, leveraging the capabilities of C# Source Generators to provide compile-time validation logic generation. The library is designed to simplify model validation in .NET applications by automatically generating validation code based on attributes and custom rules, reducing runtime overhead and enhancing code maintainability. + +## Key Features +- **Compile-Time Code Generation**: Uses C# Source Generators to create validation code at compile-time, eliminating the need for runtime reflection and improving performance. +- **Attribute-Based Validation**: Define validation rules using simple attributes directly on your models, allowing clear and maintainable validation rules. +- **Property and Object-Level Validation**: Supports validation of individual properties as well as the model as a whole, enabling both fine-grained and aggregate validations. +- **Customizable Validation Logic**: Extend the library with custom validation attributes and rules to meet unique validation requirements. +- **Detailed Validation Results**: Provides rich validation results, including per-property error messages and model-wide validation summaries. +- **Seamless Integration**: Designed to work smoothly in .NET applications, with support for dependency injection and easy configuration. + +## Getting Started +To start using the library, add it to your project as a NuGet package. Decorate your model with `[Validatable]` attribute and properties with validation attributes and let the source generator handle the rest. Generated code will include optimized validation methods that you can call to validate instances of your models. + +## Example Usage +Define validation rules using attributes on your model properties: + +```csharp +[Validatable] +public partial class CreateUserRequest +{ + [Required] + [MinLength(3)] + [MaxLength(100)] + public string Name { get; set; } + + [Required] + [EmailAddress] + public string Email { get; set; } + + [Range(18, 99)] + public int Age { get; set; } +} +``` + +Validate the model in your application code: +```csharp +app.MapPost("/users", async (CreateUserRequest request) => +{ + var validationResult = request.Validate(); // This method is generated by the source generator + + if (!validationResult.IsSuccess) + { + return Results.BadRequest(validationResult); + } + + // create user... + return Results.Created($"/users/{user.Id}"); +}); +``` + +## Installation +Install the package via NuGet: +```bash +dotnet add package Validly +``` + +Install the source generator package to enable compile-time validation code generation: +```bash +dotnet add package Validly.SourceGenerator +``` + +Install the package with default validators: +```bash +dotnet add package Validly.Extensions.Validators +``` + +## Why Validly? Why Attribute-Based Validation? +**Validly** was born out of the need for a simple, performant way to handle validations in applications, particularly when following Domain-Driven Design (DDD). In DDD, entities are responsible for their own validation. While validations on the API level are important, they cannot be the sole safeguard. The domain must validate entities independently, as the API is just one entry point to your system. Other sources, like background jobs or message queues, can also create or interact with domain objects. + +Humans make mistakes, and developers are no exception. Relying solely on API-level validations is risky; you need a robust validation layer directly in your domain to ensure data integrity across all interactions. + +**Why Not Existing Libraries?** + +Libraries like FluentValidation are powerful, but they have limitations: + +- Reflection-based design: While flexible, this approach bypasses static code analysis, making your code harder to refactor and less performant. +- Complexity: These libraries often require additional boilerplate code and are more suited to abstract validation pipelines, such as middleware in an API, than to domain entities. + +Validly solves these issues by offering an attribute-based, source-generator-powered approach for validations. It combines simplicity, static analysis support, and high performance, making it an ideal choice for both API-level and domain-level validation. + +**Why Attribute-Based Validation?** + +Most validations are straightforward and can be expressed cleanly with attributes. For example, validating that a string is not empty or a number falls within a range shouldn’t require excessive boilerplate. Attributes allow you to express such requirements concisely and directly within your model. + +Separating validations from the model may even be considered an anti-pattern or a violation of the Single Responsibility Principle. When validations are defined externally, it increases the likelihood of developer errors—such as forgetting to update validations when the model changes. By keeping validations close to the model, Validly ensures consistency, simplifies maintenance, and minimizes mistakes. + +## Contributors + + + + + + + + + + + + + + +
Roman Jámbor
Roman Jámbor

💻 🚧 📖 👀 💡 🤔 🚇 💬 ⚠️
Whitepalko
Whitepalko

💻 🤔
TallasDev
TallasDev

🤔
completezero
completezero

⚠️
Степан
Степан

💻
+ + + + + + +## License +This project is licensed under the MIT License. + +--- +This .NET validation library aims to streamline validation in .NET applications, leveraging modern C# features for performance and ease of use. It’s ideal for developers looking to minimize boilerplate code and maximize performance in their validation routines. diff --git a/v2/rscg_examples/validly/src/.tours/validly.tour b/v2/rscg_examples/validly/src/.tours/validly.tour new file mode 100644 index 000000000..32f6d884d --- /dev/null +++ b/v2/rscg_examples/validly/src/.tours/validly.tour @@ -0,0 +1,36 @@ + +{ + "$schema": "https://aka.ms/codetour-schema", + "title": "validly", + "steps": + [ + { + "file": "Valid/Valid.csproj", + "description": "First, we add Nuget [validly](https://www.nuget.org/packages/validly/) in csproj ", + "pattern": "validly" + } + + ,{ + "file": "Valid/Person.cs", + "description": "File Person.cs ", + "pattern": "this is the code" + } + + ,{ + "file": "Valid/Program.cs", + "description": "File Program.cs \r\n>> dotnet run --project Valid/Valid.csproj ", + "pattern": "this is the code" + } + + + ,{ + "file": "Valid/obj/GX/Validly.SourceGenerator/Validly.SourceGenerator.ValidatableSourceGenerator/Person.Validator.g.cs", + "description": "Generated File 1 from 1 : Person.Validator.g.cs ", + "line": 1 + } + + ], + + "ref": "main" + +} \ No newline at end of file diff --git a/v2/rscg_examples/validly/src/Valid.sln b/v2/rscg_examples/validly/src/Valid.sln new file mode 100644 index 000000000..0d3d3bcef --- /dev/null +++ b/v2/rscg_examples/validly/src/Valid.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.14.36518.9 d17.14 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Valid", "Valid\Valid.csproj", "{8CFD65C7-AE3F-42D1-BA17-B9BA385A1B00}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {8CFD65C7-AE3F-42D1-BA17-B9BA385A1B00}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8CFD65C7-AE3F-42D1-BA17-B9BA385A1B00}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8CFD65C7-AE3F-42D1-BA17-B9BA385A1B00}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8CFD65C7-AE3F-42D1-BA17-B9BA385A1B00}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {464D9BC3-8A10-4A6E-ACB8-C62CC10BF6F6} + EndGlobalSection +EndGlobal diff --git a/v2/rscg_examples/validly/src/Valid/Person.cs b/v2/rscg_examples/validly/src/Valid/Person.cs new file mode 100644 index 000000000..c77f95665 --- /dev/null +++ b/v2/rscg_examples/validly/src/Valid/Person.cs @@ -0,0 +1,14 @@ +using System.ComponentModel.DataAnnotations; +using Validly; + +namespace Valid; +[Validatable] +public partial class Person +{ + [Range(18, 199)] + public int Age { get; set; } + + [Required] + [MinLength(3)] + public string Name { get; set; } = string.Empty; +} diff --git a/v2/rscg_examples/validly/src/Valid/Program.cs b/v2/rscg_examples/validly/src/Valid/Program.cs new file mode 100644 index 000000000..43d920a91 --- /dev/null +++ b/v2/rscg_examples/validly/src/Valid/Program.cs @@ -0,0 +1,7 @@ +// See https://aka.ms/new-console-template for more information +using Valid; + +Console.WriteLine("Hello, World!"); +Person p= new (){ Age = 55, Name = "Andrei" }; +p.Validate(); +Console.WriteLine("Person is valid"); \ No newline at end of file diff --git a/v2/rscg_examples/validly/src/Valid/Valid.csproj b/v2/rscg_examples/validly/src/Valid/Valid.csproj new file mode 100644 index 000000000..8e7bcfe7a --- /dev/null +++ b/v2/rscg_examples/validly/src/Valid/Valid.csproj @@ -0,0 +1,20 @@ + + + + Exe + net9.0 + enable + enable + + + true + $(BaseIntermediateOutputPath)\GX + + + + + + + + + diff --git a/v2/rscg_examples/validly/video.json b/v2/rscg_examples/validly/video.json new file mode 100644 index 000000000..1b41cc623 --- /dev/null +++ b/v2/rscg_examples/validly/video.json @@ -0,0 +1,39 @@ +{ + "scriptName": "validly", + "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 validly . Generates validation code for C# classes based on attributes. ."}, +{"typeStep":"browser","arg":"https://www.nuget.org/packages/validly/"}, +{"typeStep":"text","arg": "The whole example is here"}, +{"typeStep":"browser","arg":"https://ignatandrei.github.io/RSCG_Examples/v2/docs/validly"}, +{"typeStep":"text","arg": "You can download the code from here"}, +{"typeStep":"browser","arg":"https://ignatandrei.github.io/RSCG_Examples/v2/docs/validly#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\\Validly\\src\\Valid.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\\Validly\\src"}, + +{"typeStep":"text","arg": "To use it ,you will put the Nuget validly into the csproj "}, + +{"typeStep":"stepvscode","arg": "-r -g D:\\gth\\RSCG_Examples\\v2\\rscg_examples\\Validly\\src\\Valid\\Valid.csproj"}, + +{"typeStep":"text","arg": "And now I will show you an example of using validly"}, + +{"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":"Valid.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/validly#download-example-net--c-", +SpeakTest=" "}, +{"typeStep":"waitseconds","arg":"30"}, +] +} diff --git a/v2/rscg_examples_site/docs/Categories/Validator.md b/v2/rscg_examples_site/docs/Categories/Validator.md new file mode 100644 index 000000000..d90cc8cd2 --- /dev/null +++ b/v2/rscg_examples_site/docs/Categories/Validator.md @@ -0,0 +1,6 @@ +

Validator

+ +Number RSCG: 1 + + 1 [validly](/docs/validly) + \ No newline at end of file diff --git a/v2/rscg_examples_site/docs/Categories/_PrimitiveValidator.mdx b/v2/rscg_examples_site/docs/Categories/_PrimitiveValidator.mdx new file mode 100644 index 000000000..9ff244d16 --- /dev/null +++ b/v2/rscg_examples_site/docs/Categories/_PrimitiveValidator.mdx @@ -0,0 +1,7 @@ +### Category "Validator" has the following generators: + + 1 [validly](/docs/validly) + +### See category + +[Validator](/docs/Categories/Validator) diff --git a/v2/rscg_examples_site/docs/NoExamples.md b/v2/rscg_examples_site/docs/NoExamples.md index 070cfe60b..df4cb304b 100644 --- a/v2/rscg_examples_site/docs/NoExamples.md +++ b/v2/rscg_examples_site/docs/NoExamples.md @@ -302,415 +302,407 @@ Why I have not put example: later Why I have not put example: issue opened -75)https://github.com/Hookyns/validly https://github.com/Hookyns/validly - -Why I have not put example: later - -76)https://github.com/inputfalken/Dynatello https://github.com/inputfalken/Dynatello +75)https://github.com/inputfalken/Dynatello https://github.com/inputfalken/Dynatello Why I have not put example: too complicated -77)https://github.com/ionite34/MinimalApiMapper https://github.com/ionite34/MinimalApiMapper +76)https://github.com/ionite34/MinimalApiMapper https://github.com/ionite34/MinimalApiMapper Why I have not put example: own idea where to generate files, so overwrites -78)https://github.com/JasonBock/CslaGeneratorSerialization https://github.com/JasonBock/CslaGeneratorSerialization +77)https://github.com/JasonBock/CslaGeneratorSerialization https://github.com/JasonBock/CslaGeneratorSerialization Why I have not put example: too complicated -79)https://github.com/nevsnirG/MinimalRichDomain https://github.com/nevsnirG/MinimalRichDomain +78)https://github.com/nevsnirG/MinimalRichDomain https://github.com/nevsnirG/MinimalRichDomain Why I have not put example: old ISourceGenerator -80)https://github.com/nuskey8/Csv-CSharp https://github.com/nuskey8/Csv-CSharp - -Why I have not put example: later - -81)https://github.com/OrgEleCho/EleCho.Internationalization https://github.com/OrgEleCho/EleCho.Internationalization +79)https://github.com/OrgEleCho/EleCho.Internationalization https://github.com/OrgEleCho/EleCho.Internationalization Why I have not put example: issue opened -82)https://github.com/pierre3/PlantUmlClassDiagramGenerator https://github.com/pierre3/PlantUmlClassDiagramGenerator +80)https://github.com/pierre3/PlantUmlClassDiagramGenerator https://github.com/pierre3/PlantUmlClassDiagramGenerator Why I have not put example: later -83)https://github.com/ramhari-dev/PropGenAoT https://github.com/ramhari-dev/PropGenAoT +81)https://github.com/ramhari-dev/PropGenAoT https://github.com/ramhari-dev/PropGenAoT Why I have not put example: no readme -84)https://github.com/stbychkov/AutoLoggerMessage https://github.com/stbychkov/AutoLoggerMessage +82)https://github.com/stbychkov/AutoLoggerMessage https://github.com/stbychkov/AutoLoggerMessage Why I have not put example: Microsoft have done same feature -85)https://github.com/Stepami/visitor-net https://github.com/Stepami/visitor-net +83)https://github.com/Stepami/visitor-net https://github.com/Stepami/visitor-net Why I have not put example: later -86)https://github.com/svee4/RequiredStaticMembers https://github.com/svee4/RequiredStaticMembers +84)https://github.com/svee4/RequiredStaticMembers https://github.com/svee4/RequiredStaticMembers Why I have not put example: issue opened -87)https://github.com/SzymonHalucha/Minerals.AutoCommands https://github.com/SzymonHalucha/Minerals.AutoCommands +85)https://github.com/SzymonHalucha/Minerals.AutoCommands https://github.com/SzymonHalucha/Minerals.AutoCommands Why I have not put example: later -88)https://github.com/Teleopti/Saspect https://github.com/Teleopti/Saspect +86)https://github.com/Teleopti/Saspect https://github.com/Teleopti/Saspect Why I have not put example: later -89)https://github.com/TheFo2sh/AsyncFlow https://github.com/TheFo2sh/AsyncFlow +87)https://github.com/TheFo2sh/AsyncFlow https://github.com/TheFo2sh/AsyncFlow Why I have not put example: too complicated -90)https://github.com/wieslawsoltes/ReactiveGenerator https://github.com/wieslawsoltes/ReactiveGenerator +88)https://github.com/wieslawsoltes/ReactiveGenerator https://github.com/wieslawsoltes/ReactiveGenerator Why I have not put example: too complicated -91)HubClientProxyGenerator https://www.nuget.org/packages/Microsoft.AspNetCore.SignalR.Client.SourceGenerator +89)HubClientProxyGenerator https://www.nuget.org/packages/Microsoft.AspNetCore.SignalR.Client.SourceGenerator Why I have not put example: not having nuget, but having IIncrementalGenerator -92)Imp.NET https://github.com/DouglasDwyer/Imp.NET +90)Imp.NET https://github.com/DouglasDwyer/Imp.NET Why I have not put example: old ISourceGenerator -93)Intellenum https://github.com/SteveDunn/Intellenum +91)Intellenum https://github.com/SteveDunn/Intellenum Why I have not put example: not understand how to use -94)InterfaceGenerator https://github.com/daver32/InterfaceGenerator +92)InterfaceGenerator https://github.com/daver32/InterfaceGenerator Why I have not put example: old ISourceGenerator -95)IoTHubClientGenerator https://github.com/alonf/IoTHubClientGenerator +93)IoTHubClientGenerator https://github.com/alonf/IoTHubClientGenerator Why I have not put example: old ISourceGenerator -96)JsonByExampleGenerator https://github.com/hermanussen/JsonByExampleGenerator +94)JsonByExampleGenerator https://github.com/hermanussen/JsonByExampleGenerator Why I have not put example: old ISourceGenerator -97)JsonDeserializeResourceSourceGenerator https://github.com/musictopia2/JsonDeserializeResourceSourceGenerator +95)JsonDeserializeResourceSourceGenerator https://github.com/musictopia2/JsonDeserializeResourceSourceGenerator Why I have not put example: no readme -98)JsonMergePatch https://github.com/ladeak/JsonMergePatch +96)JsonMergePatch https://github.com/ladeak/JsonMergePatch Why I have not put example: old ISourceGenerator -99)JsonSerializerContextGenerator https://github.com/musictopia2/JsonSerializerContextGenerator +97)JsonSerializerContextGenerator https://github.com/musictopia2/JsonSerializerContextGenerator Why I have not put example: no readme -100)JsonSourceGenerator https://github.com/Pilchie/JsonSourceGenerator +98)JsonSourceGenerator https://github.com/Pilchie/JsonSourceGenerator Why I have not put example: not having nuget, but having IIncrementalGenerator -101)JsonSrcGen https://github.com/trampster/JsonSrcGen +99)JsonSrcGen https://github.com/trampster/JsonSrcGen Why I have not put example: old ISourceGenerator -102)kli.Localize https://github.com/kl1mm/localize +100)kli.Localize https://github.com/kl1mm/localize Why I have not put example: old ISourceGenerator -103)laker https://github.com/Lakerfield/Lakerfield.Rpc +101)laker https://github.com/Lakerfield/Lakerfield.Rpc Why I have not put example: too complicated -104)lambdajection https://github.com/cythral/lambdajection +102)lambdajection https://github.com/cythral/lambdajection Why I have not put example: old ISourceGenerator -105)Lazysh https://github.com/B1Z0N/LazyshGen +103)Lazysh https://github.com/B1Z0N/LazyshGen Why I have not put example: old ISourceGenerator -106)LoggingDecoratorGenerator https://github.com/DavidFineboym/LoggingDecoratorGenerator +104)LoggingDecoratorGenerator https://github.com/DavidFineboym/LoggingDecoratorGenerator Why I have not put example: Microsoft have done same feature -107)lucide-blazor https://github.com/brecht-vde/lucide-blazor/ +105)lucide-blazor https://github.com/brecht-vde/lucide-blazor/ Why I have not put example: issue opened -108)ManagedDotnetProfiler https://github.com/kevingosse/ManagedDotnetProfiler +106)ManagedDotnetProfiler https://github.com/kevingosse/ManagedDotnetProfiler Why I have not put example: too complicated -109)MapDataReader https://github.com/jitbit/MapDataReader +107)MapDataReader https://github.com/jitbit/MapDataReader Why I have not put example: old ISourceGenerator -110)MappingCloningExtensions https://github.com/musictopia2/MappingCloningExtensions +108)MappingCloningExtensions https://github.com/musictopia2/MappingCloningExtensions Why I have not put example: no readme -111)Maui.BindableProperty.Generator https://github.com/rrmanzano/maui-bindableproperty-generator +109)Maui.BindableProperty.Generator https://github.com/rrmanzano/maui-bindableproperty-generator Why I have not put example: later -112)MediatR https://github.com/Burgyn/MMLib.MediatR.Generators +110)MediatR https://github.com/Burgyn/MMLib.MediatR.Generators Why I have not put example: old ISourceGenerator -113)MemberAccessGenerator https://github.com/ufcpp/MemberAccessGenerator +111)MemberAccessGenerator https://github.com/ufcpp/MemberAccessGenerator Why I have not put example: old ISourceGenerator -114)MemoizeSourceGenerator https://github.com/Zoxive/MemoizeSourceGenerator +112)MemoizeSourceGenerator https://github.com/Zoxive/MemoizeSourceGenerator Why I have not put example: old ISourceGenerator -115)Minerals.AutoCQRS https://github.com/SzymonHalucha/Minerals.AutoCQRS +113)Minerals.AutoCQRS https://github.com/SzymonHalucha/Minerals.AutoCQRS Why I have not put example: later -116)Minerals.AutoDomain https://github.com/SzymonHalucha/Minerals.AutoDomain +114)Minerals.AutoDomain https://github.com/SzymonHalucha/Minerals.AutoDomain Why I have not put example: later -117)MiniRazor https://github.com/Tyrrrz/MiniRazor/ +115)MiniRazor https://github.com/Tyrrrz/MiniRazor/ Why I have not put example: archived -118)MockableStaticGenerator https://github.com/HamedFathi/MockableStaticGenerator +116)MockableStaticGenerator https://github.com/HamedFathi/MockableStaticGenerator Why I have not put example: old ISourceGenerator -119)MockGen https://github.com/thomas-girotto/MockGen +117)MockGen https://github.com/thomas-girotto/MockGen Why I have not put example: old ISourceGenerator -120)MockSourceGenerator https://github.com/hermanussen/MockSourceGenerator +118)MockSourceGenerator https://github.com/hermanussen/MockSourceGenerator Why I have not put example: old ISourceGenerator -121)MrMeeseeks.DIE https://github.com/Yeah69/MrMeeseeks.DIE +119)MrMeeseeks.DIE https://github.com/Yeah69/MrMeeseeks.DIE Why I have not put example: old ISourceGenerator -122)MrMeeseeks.ResXToViewModelGenerator https://github.com/Yeah69/MrMeeseeks.ResXToViewModelGenerator +120)MrMeeseeks.ResXToViewModelGenerator https://github.com/Yeah69/MrMeeseeks.ResXToViewModelGenerator Why I have not put example: old ISourceGenerator -123)MrMeeseeks.StaticDelegateGenerator https://github.com/Yeah69/MrMeeseeks.StaticDelegateGenerator +121)MrMeeseeks.StaticDelegateGenerator https://github.com/Yeah69/MrMeeseeks.StaticDelegateGenerator Why I have not put example: old ISourceGenerator -124)MrMeeseeks.Visitor https://github.com/Yeah69/MrMeeseeks.Visitor +122)MrMeeseeks.Visitor https://github.com/Yeah69/MrMeeseeks.Visitor Why I have not put example: old ISourceGenerator -125)Neon.Roslyn https://www.nuget.org/packages/Neon.Roslyn +123)Neon.Roslyn https://www.nuget.org/packages/Neon.Roslyn Why I have not put example: old ISourceGenerator -126)net_automatic_interface https://github.com/codecentric/net_automatic_interface +124)net_automatic_interface https://github.com/codecentric/net_automatic_interface Why I have not put example: old ISourceGenerator -127)NSourceGenerators https://github.com/NeVeSpl/NSourceGenerators/ +125)NSourceGenerators https://github.com/NeVeSpl/NSourceGenerators/ Why I have not put example: old ISourceGenerator -128)observable https://github.com/notanaverageman/Bindables +126)observable https://github.com/notanaverageman/Bindables Why I have not put example: later -129)Pipelines https://github.com/DumplingsDevs/Pipelines/ +127)Pipelines https://github.com/DumplingsDevs/Pipelines/ Why I have not put example: old ISourceGenerator -130)Plastic https://github.com/sang-hyeon/Plastic +128)Plastic https://github.com/sang-hyeon/Plastic Why I have not put example: old ISourceGenerator -131)PolySharp https://github.com/Sergio0694/PolySharp +129)PolySharp https://github.com/Sergio0694/PolySharp Why I have not put example: too complicated -132)PrimaryConstructor https://github.com/chaowlert/PrimaryConstructor +130)PrimaryConstructor https://github.com/chaowlert/PrimaryConstructor Why I have not put example: old ISourceGenerator -133)PrimitiveStaticDataGenerator https://github.com/iiweis/PrimitiveStaticDataGenerator +131)PrimitiveStaticDataGenerator https://github.com/iiweis/PrimitiveStaticDataGenerator Why I have not put example: old ISourceGenerator -134)PrintMembersGenerator https://github.com/Youssef1313/PrintMembersGenerator +132)PrintMembersGenerator https://github.com/Youssef1313/PrintMembersGenerator Why I have not put example: old ISourceGenerator -135)ProxyInterfaceGenerator https://github.com/StefH/ProxyInterfaceSourceGenerator +133)ProxyInterfaceGenerator https://github.com/StefH/ProxyInterfaceSourceGenerator Why I have not put example: old ISourceGenerator -136)PureHDF https://github.com/Apollo3zehn/PureHDF +134)PureHDF https://github.com/Apollo3zehn/PureHDF Why I have not put example: old ISourceGenerator -137)RazorGen https://github.com/dartk/RazorGen +135)RazorGen https://github.com/dartk/RazorGen Why I have not put example: later -138)RazorPageRouteGenerator https://github.com/surgicalcoder/RazorPageRouteGenerator +136)RazorPageRouteGenerator https://github.com/surgicalcoder/RazorPageRouteGenerator Why I have not put example: old ISourceGenerator -139)ReForge.Union https://github.com/nalcorso/ReForge.Union +137)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 +138)RoslynWeave https://github.com/Jishun/RoslynWeave Why I have not put example: old ISourceGenerator -141)ScenarioTests https://github.com/koenbeuk/ScenarioTests +139)ScenarioTests https://github.com/koenbeuk/ScenarioTests Why I have not put example: old ISourceGenerator -142)SerdeDn https://github.com/serdedotnet/serde +140)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 +141)SmallSharp https://github.com/devlooped/SmallSharp Why I have not put example: old ISourceGenerator -144)SmartAnnotations https://github.com/fiseni/SmartAnnotations +142)SmartAnnotations https://github.com/fiseni/SmartAnnotations Why I have not put example: old ISourceGenerator -145)SogePoco https://github.com/d-p-y/SogePoco +143)SogePoco https://github.com/d-p-y/SogePoco Why I have not put example: too complicated -146)SourceApi https://github.com/alekshura/SourceApi +144)SourceApi https://github.com/alekshura/SourceApi Why I have not put example: old ISourceGenerator -147)SourceConfig https://github.com/alekshura/SourceConfig +145)SourceConfig https://github.com/alekshura/SourceConfig Why I have not put example: old ISourceGenerator -148)SourceCrafter.HttpServiceClientGenerator https://github.com/pedro-gilmora/SourceCrafter.HttpServiceClientGenerator/ +146)SourceCrafter.HttpServiceClientGenerator https://github.com/pedro-gilmora/SourceCrafter.HttpServiceClientGenerator/ Why I have not put example: later -149)SourceGeneratorQuery https://github.com/roeibajayo/SourceGeneratorQuery +147)SourceGeneratorQuery https://github.com/roeibajayo/SourceGeneratorQuery Why I have not put example: old ISourceGenerator -150)SourceInject https://github.com/giggio/sourceinject/ +148)SourceInject https://github.com/giggio/sourceinject/ Why I have not put example: old ISourceGenerator -151)SourceMapper https://github.com/alekshura/SourceMapper +149)SourceMapper https://github.com/alekshura/SourceMapper Why I have not put example: old ISourceGenerator -152)SourceMapper https://github.com/paiden/SourceMapper/ +150)SourceMapper https://github.com/paiden/SourceMapper/ Why I have not put example: old ISourceGenerator -153)SqlMarshal https://github.com/kant2002/SqlMarshal +151)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 +152)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 +153)StackXML https://github.com/ZingBallyhoo/StackXML Why I have not put example: old ISourceGenerator -156)StaticProxyGenerator https://github.com/robertturner/StaticProxyGenerator +154)StaticProxyGenerator https://github.com/robertturner/StaticProxyGenerator Why I have not put example: old ISourceGenerator -157)StrongInject https://github.com/YairHalberstadt/stronginject/ +155)StrongInject https://github.com/YairHalberstadt/stronginject/ Why I have not put example: later -158)StronglyTypedEmbeddedResources https://github.com/surgicalcoder/StronglyTypedEmbeddedResources +156)StronglyTypedEmbeddedResources https://github.com/surgicalcoder/StronglyTypedEmbeddedResources Why I have not put example: old ISourceGenerator -159)StructPacker https://github.com/RudolfKurka/StructPacker +157)StructPacker https://github.com/RudolfKurka/StructPacker Why I have not put example: old ISourceGenerator -160)Svg https://github.com/wieslawsoltes/Svg.Skia +158)Svg https://github.com/wieslawsoltes/Svg.Skia Why I have not put example: old ISourceGenerator -161)tecli https://github.com/tyevco/TeCLI +159)tecli https://github.com/tyevco/TeCLI Why I have not put example: old ISourceGenerator -162)TeuJson https://github.com/Terria-K/TeuJson +160)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 +161)Thunderboltloc https://github.com/AlyElhaddad/ThunderboltIoc Why I have not put example: old ISourceGenerator -164)Tinyhand https://github.com/archi-Doc/Tinyhand +162)Tinyhand https://github.com/archi-Doc/Tinyhand Why I have not put example: tried, need documentation -165)ToString https://github.com/Burgyn/MMLib.ToString +163)ToString https://github.com/Burgyn/MMLib.ToString Why I have not put example: old ISourceGenerator -166)Transplator https://github.com/atifaziz/Transplator +164)Transplator https://github.com/atifaziz/Transplator Why I have not put example: old ISourceGenerator -167)TupleOverloadGenerator https://github.com/ProphetLamb/TupleOverloadGenerator +165)TupleOverloadGenerator https://github.com/ProphetLamb/TupleOverloadGenerator Why I have not put example: too complicated -168)TxtToListGenerator https://github.com/musictopia2/TxtToListGenerator +166)TxtToListGenerator https://github.com/musictopia2/TxtToListGenerator Why I have not put example: no readme -169)TypealizR https://github.com/earloc/TypealizR +167)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 +168)UnitTestBlazor https://github.com/bUnit-dev/bUnit Why I have not put example: issue opened -171)ValueChangedGenerator https://github.com/ufcpp/ValueChangedGenerator +169)ValueChangedGenerator https://github.com/ufcpp/ValueChangedGenerator Why I have not put example: old ISourceGenerator -172)ValueLink https://github.com/archi-Doc/ValueLink +170)ValueLink https://github.com/archi-Doc/ValueLink Why I have not put example: too complicated -173)ValueObjectGenerator https://github.com/RyotaMurohoshi/ValueObjectGenerator +171)ValueObjectGenerator https://github.com/RyotaMurohoshi/ValueObjectGenerator Why I have not put example: old ISourceGenerator -174)VisitorPatternGenerator https://github.com/hikarin522/VisitorPatternGenerator/ +172)VisitorPatternGenerator https://github.com/hikarin522/VisitorPatternGenerator/ Why I have not put example: issue opened -175)Visor https://github.com/Tinkoff/Visor +173)Visor https://github.com/Tinkoff/Visor Why I have not put example: archived -176)WrapperValueObject https://github.com/martinothamar/WrapperValueObject +174)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 +175)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/Csvcsharp.md b/v2/rscg_examples_site/docs/RSCG-Examples/Csvcsharp.md index 76248b78c..1945902bd 100644 --- a/v2/rscg_examples_site/docs/RSCG-Examples/Csvcsharp.md +++ b/v2/rscg_examples_site/docs/RSCG-Examples/Csvcsharp.md @@ -12,7 +12,7 @@ import SameCategory from '../Categories/_PrimitiveSerializer.mdx'; # Csvcsharp by Yusuke Nakada - + ## NuGet / site data [![Nuget](https://img.shields.io/nuget/dt/Csvcsharp?label=Csvcsharp)](https://www.nuget.org/packages/Csvcsharp/) diff --git a/v2/rscg_examples_site/docs/RSCG-Examples/index.md b/v2/rscg_examples_site/docs/RSCG-Examples/index.md index ad2708268..4059373f4 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: 235 RSCG list by category -description: 235 RSCG list by category +title: 236 RSCG list by category +description: 236 RSCG list by category slug: /rscg-examples --- @@ -1436,6 +1436,18 @@ import DocCardList from '@theme/DocCardList'; +## Validator +
+ + Expand Validator =>examples:1 + + + +[validly](/docs/validly) + +
+ + ## WinAPI
@@ -1927,6 +1939,8 @@ flowchart LR; Tests--> MockMe((MockMe)) + Validator--> validly((validly)) + WinAPI--> Com((Com)) WinAPI--> Microsoft.Windows.CsWin32((Microsoft.Windows.CsWin32)) diff --git a/v2/rscg_examples_site/docs/RSCG-Examples/validly.md b/v2/rscg_examples_site/docs/RSCG-Examples/validly.md new file mode 100644 index 000000000..297a75b7e --- /dev/null +++ b/v2/rscg_examples_site/docs/RSCG-Examples/validly.md @@ -0,0 +1,382 @@ +--- +sidebar_position: 2360 +title: 236 - validly +description: Generates validation code for C# classes based on attributes. +slug: /validly +--- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; +import TOCInline from '@theme/TOCInline'; +import SameCategory from '../Categories/_PrimitiveValidator.mdx'; + +# validly by Roman Jambor + + + + +## NuGet / site data +[![Nuget](https://img.shields.io/nuget/dt/validly?label=validly)](https://www.nuget.org/packages/validly/) +[![GitHub last commit](https://img.shields.io/github/last-commit/Hookyns/validly?label=updated)](https://github.com/Hookyns/validly) +![GitHub Repo stars](https://img.shields.io/github/stars/Hookyns/validly?style=social) + +## Details + +### Info +:::info + +Name: **validly** + +Powerful, efficient, and highly customizable validation library for .NET, leveraging the capabilities of C# Source Generators to provide compile-time validation logic generation. + +Author: Roman Jambor + +NuGet: +*https://www.nuget.org/packages/validly/* + + +You can find more details at https://github.com/Hookyns/validly + +Source: https://github.com/Hookyns/validly + +::: + +### Author +:::note +Roman Jambor +![Alt text](https://github.com/Hookyns.png) +::: + +### Original Readme +:::note + +# Validly + +[![NuGet](https://img.shields.io/nuget/v/Validly)](https://www.nuget.org/packages/Validly) +[![License MIT](https://img.shields.io/badge/License-MIT-brightgreen?style=flat-square)](https://opensource.org/licenses/MIT) +[![Support Ukraine](https://img.shields.io/badge/Support-Ukraine-FFDD00?labelColor=0057B7)](https://donate.redcross.org.uk/appeal/ukraine-crisis-appeal) +[![All Contributors](https://img.shields.io/badge/all_contributors-5-orange.svg?style=flat-square)](#contributors-) + + +This repository contains a powerful, efficient, and highly customizable validation library for .NET, leveraging the capabilities of C# Source Generators to provide compile-time validation logic generation. The library is designed to simplify model validation in .NET applications by automatically generating validation code based on attributes and custom rules, reducing runtime overhead and enhancing code maintainability. + +## Key Features +- **Compile-Time Code Generation**: Uses C# Source Generators to create validation code at compile-time, eliminating the need for runtime reflection and improving performance. +- **Attribute-Based Validation**: Define validation rules using simple attributes directly on your models, allowing clear and maintainable validation rules. +- **Property and Object-Level Validation**: Supports validation of individual properties as well as the model as a whole, enabling both fine-grained and aggregate validations. +- **Customizable Validation Logic**: Extend the library with custom validation attributes and rules to meet unique validation requirements. +- **Detailed Validation Results**: Provides rich validation results, including per-property error messages and model-wide validation summaries. +- **Seamless Integration**: Designed to work smoothly in .NET applications, with support for dependency injection and easy configuration. + +## Getting Started +To start using the library, add it to your project as a NuGet package. Decorate your model with `[Validatable]` attribute and properties with validation attributes and let the source generator handle the rest. Generated code will include optimized validation methods that you can call to validate instances of your models. + +## Example Usage +Define validation rules using attributes on your model properties: + +```csharp +[Validatable] +public partial class CreateUserRequest +{ + [Required] + [MinLength(3)] + [MaxLength(100)] + public string Name \{ get; set; } + + [Required] + [EmailAddress] + public string Email \{ get; set; } + + [Range(18, 99)] + public int Age \{ get; set; } +} +``` + +Validate the model in your application code: +```csharp +app.MapPost("/users", async (CreateUserRequest request) => +{ + var validationResult = request.Validate(); // This method is generated by the source generator + + if (!validationResult.IsSuccess) + { + return Results.BadRequest(validationResult); + } + + // create user... + return Results.Created($"/users/{user.Id}"); +}); +``` + +## Installation +Install the package via NuGet: +```bash +dotnet add package Validly +``` + +Install the source generator package to enable compile-time validation code generation: +```bash +dotnet add package Validly.SourceGenerator +``` + +Install the package with default validators: +```bash +dotnet add package Validly.Extensions.Validators +``` + +## Why Validly? Why Attribute-Based Validation? +**Validly** was born out of the need for a simple, performant way to handle validations in applications, particularly when following Domain-Driven Design (DDD). In DDD, entities are responsible for their own validation. While validations on the API level are important, they cannot be the sole safeguard. The domain must validate entities independently, as the API is just one entry point to your system. Other sources, like background jobs or message queues, can also create or interact with domain objects. + +Humans make mistakes, and developers are no exception. Relying solely on API-level validations is risky; you need a robust validation layer directly in your domain to ensure data integrity across all interactions. + +**Why Not Existing Libraries?** + +Libraries like FluentValidation are powerful, but they have limitations: + +- Reflection-based design: While flexible, this approach bypasses static code analysis, making your code harder to refactor and less performant. +- Complexity: These libraries often require additional boilerplate code and are more suited to abstract validation pipelines, such as middleware in an API, than to domain entities. + +Validly solves these issues by offering an attribute-based, source-generator-powered approach for validations. It combines simplicity, static analysis support, and high performance, making it an ideal choice for both API-level and domain-level validation. + +**Why Attribute-Based Validation?** + +Most validations are straightforward and can be expressed cleanly with attributes. For example, validating that a string is not empty or a number falls within a range shouldn’t require excessive boilerplate. Attributes allow you to express such requirements concisely and directly within your model. + +Separating validations from the model may even be considered an anti-pattern or a violation of the Single Responsibility Principle. When validations are defined externally, it increases the likelihood of developer errors—such as forgetting to update validations when the model changes. By keeping validations close to the model, Validly ensures consistency, simplifies maintenance, and minimizes mistakes. + +## Contributors + + + + + + + + + + + + + + +
Roman Jámbor
Roman Jámbor

💻 🚧 📖 👀 💡 🤔 🚇 💬 ⚠️
Whitepalko
Whitepalko

💻 🤔
TallasDev
TallasDev

🤔
completezero
completezero

⚠️
Степан
Степан

💻
+ + + + + + +## License +This project is licensed under the MIT License. + +--- +This .NET validation library aims to streamline validation in .NET applications, leveraging modern C# features for performance and ease of use. It’s ideal for developers looking to minimize boilerplate code and maximize performance in their validation routines. + + +::: + +### About +:::note + +Generates validation code for C# classes based on attributes. + + +::: + +## How to use + +### Example (source csproj, source files) + + + + + +This is the CSharp Project that references **validly** +```xml showLineNumbers {15} + + + + Exe + net9.0 + enable + enable + + + true + $(BaseIntermediateOutputPath)\GX + + + + + + + + + + +``` + + + + + + This is the use of **validly** in *Program.cs* + +```csharp showLineNumbers +// See https://aka.ms/new-console-template for more information +using Valid; + +Console.WriteLine("Hello, World!"); +Person p= new (){ Age = 55, Name = "Andrei" }; +p.Validate(); +Console.WriteLine("Person is valid"); +``` + + + + + This is the use of **validly** in *Person.cs* + +```csharp showLineNumbers +using System.ComponentModel.DataAnnotations; +using Validly; + +namespace Valid; +[Validatable] +public partial class Person +{ + [Range(18, 199)] + public int Age \{ get; set; } + + [Required] + [MinLength(3)] + public string Name \{ get; set; \} = string.Empty; +} + +``` + + + + +### Generated Files + +Those are taken from $(BaseIntermediateOutputPath)\GX + + + + +```csharp showLineNumbers +// +#nullable enable + +namespace Valid +{ + #pragma warning disable CS0105 + using System.ComponentModel.DataAnnotations; + using Validly; + #pragma warning restore CS0105 + + public partial class Person + : global::Validly.IValidatable, global::Validly.Validators.IInternalValidationInvoker + { + /// + ValueTask global::Validly.Validators.IInternalValidationInvoker.ValidateAsync( + global::Validly.ValidationContext context, + global::System.IServiceProvider? serviceProvider + ) + { + var result = (global::Validly.IInternalValidationResult)global::Validly.ExtendableValidationResult.Create(2); + + + global::Validly.IExpandablePropertyValidationResult propertyResult; + + // Validate "Name" property + context.SetProperty("Name"); + propertyResult = result.InitProperty("Name"); + propertyResult.Add(PersonRules.NameRule.Item1.IsValid(Name)); + + + + return new ValueTask((global::Validly.ValidationResult)result); + } + + /// + async ValueTask global::Validly.IValidatable.ValidateAsync(IServiceProvider serviceProvider){ + using var validationContext = global::Validly.ValidationContext.Create(this); + return await ((global::Validly.Validators.IInternalValidationInvoker)this).ValidateAsync(validationContext, serviceProvider); + } + + /// + /// Validate the object and get the result with error messages. + /// + /// Returns disposable ValidationResult. + public virtual async ValueTask ValidateAsync() + { + using var validationContext = global::Validly.ValidationContext.Create(this); + return await ((global::Validly.Validators.IInternalValidationInvoker)this).ValidateAsync(validationContext, null); + } + + + /// + /// Validate the object and get the result with error messages. + /// + /// Returns disposable ValidationResult. + public virtual global::Validly.ValidationResult Validate() + { + using var validationContext = global::Validly.ValidationContext.Create(this); + var task = ((global::Validly.Validators.IInternalValidationInvoker)this).ValidateAsync(validationContext, null); + + if (!task.IsCompletedSuccessfully) + { + #if NET7_0_OR_GREATER + throw new global::System.Diagnostics.UnreachableException("The task should be completed synchronously but was not."); + #else + throw new global::System.InvalidOperationException("The task should be completed synchronously but was not."); + #endif + } + + return task.Result; + } + + } + + file static class PersonRules + { + internal static readonly ValueTuple< + global::Validly.Extensions.Validators.Common.RequiredAttribute, + object? + > NameRule = ( + new global::Validly.Extensions.Validators.Common.RequiredAttribute(allowEmptyStrings: true), + null + ); + } + +} +``` + + + + +## Useful + +### Download Example (.NET C#) + +:::tip + +[Download Example project validly ](/sources/validly.zip) + +::: + + +### Share validly + + + +https://ignatandrei.github.io/RSCG_Examples/v2/docs/validly + + + diff --git a/v2/rscg_examples_site/docs/about.md b/v2/rscg_examples_site/docs/about.md index f64303ec6..2e18b0d42 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 235 Roslyn Source Code Generator (RSCG) +of 236 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 06128c371..7b35d0e5a 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'; -## 235 RSCG with examples in descending chronological order +## 236 RSCG with examples in descending chronological order -This is the list of 235 ( 14 from Microsoft) RSCG with examples +This is the list of 236 ( 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 235 ( 14 from Microsoft) RSCG with examples | No | Name | Date | Category | | --------- | ----- | ---- | -------- | +|236| [validly by Roman Jambor ](/docs/validly)|2025-10-06 => 06 October 2025 | [Validator](/docs/Categories/Validator) | |235| [Csvcsharp by Yusuke Nakada ](/docs/Csvcsharp)|2025-10-05 => 05 October 2025 | [Serializer](/docs/Categories/Serializer) | |234| [RapidEnum by hanachiru ](/docs/RapidEnum)|2025-10-04 => 04 October 2025 | [Enum](/docs/Categories/Enum) | |233| [VYaml by Hadashi A ](/docs/VYaml)|2025-10-03 => 03 October 2025 | [Serializer](/docs/Categories/Serializer) | diff --git a/v2/rscg_examples_site/src/components/HomepageFeatures/index.js b/v2/rscg_examples_site/src/components/HomepageFeatures/index.js index 1cd427ea5..6c19a7f65 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: '235 Examples (14 from MSFT)', +title: '236 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 1ca221e5c..0ca7479e1 100644 --- a/v2/rscg_examples_site/static/exports/RSCG.json +++ b/v2/rscg_examples_site/static/exports/RSCG.json @@ -1881,6 +1881,14 @@ "Source": "https://github.com/nuskey8/Csv-CSharp", "Category": "Serializer", "AddedOn": "2025-10-05T00:00:00" + }, + { + "Name": "validly", + "Link": "https://ignatandrei.github.io/RSCG_Examples/v2/docs/Validly", + "NuGet": "https://www.nuget.org/packages/validly/", + "Source": "https://github.com/Hookyns/validly", + "Category": "Validator", + "AddedOn": "2025-10-06T00: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 65f8ba196..b478ad539 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/validly.zip b/v2/rscg_examples_site/static/sources/validly.zip new file mode 100644 index 000000000..966478bee Binary files /dev/null and b/v2/rscg_examples_site/static/sources/validly.zip differ