Category: roslyn

  • Evolving Roslyn Source Code Generators

    I am a big fan of Roslyn Source Code Generators – you can read about at https://github.com/dotnet/roslyn/blob/main/docs/features/source-generators.md and https://devblogs.microsoft.com/dotnet/introducing-c-source-generators/. I have tested,until now,27 examples and discovered other 53 RSCG – you can read about at https://github.com/ignatandrei/RSCG_Examples and download the book from  https://ignatandrei.github.io/RSCG_Examples/ Also,Microsoft is dogfooding this by using at Blazor ( https://devblogs.microsoft.com/aspnet/asp-net-core-updates-in-net-6-preview-2/#razor-compiler-updated-to-use-source-generators ),JSON.NET https://devblogs.microsoft.com/dotnet/try-the-new-system-text-json-source-generator/ .…

  • RSCG Example – AOPMarker for CI Builds – part 30

        name AOPMarkerCI nuget https://www.nuget.org/packages/AOPMethodsCommon/ https://www.nuget.org/packages/AOPMethodsGenerator/ link http://msprogrammer.serviciipeweb.ro/category/roslyn/ author Andrei Ignat This will tracing methods marked with AOPMarkerMethod in CI builds. Does not affect the code run by the programmer.   The code that you start with is The code that you will use is   The code that is generated is Example Code:…

  • RSCG Example – Class2Interface – part 29

        name BoilerplateFree nuget https://www.nuget.org/packages/boilerplatefree link https://github.com/GeeWee/boilerplatefree author Gustav Wengel This will generate interface from a class   The code that you start with is The code that you will use is   The code that is generated is Example Code: https://github.com/ignatandrei/RSCG_Examples/tree/main/Class2Interface

  • RSCG Example – ToStringDebugger – part 28

        name StructRecordsGenerator nuget https://www.nuget.org/packages/StructRecordGenerator/ link https://github.com/SergeyTeplyakov/StructRecordsGenerator author Sergey Teplyakov This will generate code .ToString. Usefull for debugging   The code that you start with is The code that you will use is   The code that is generated is Example Code: https://github.com/ignatandrei/RSCG_Examples/tree/main/DebuggerToString

  • RSCG Example–TimeBombComment–part 27

        name RSCG_TimeBombComment nuget https://www.nuget.org/packages/RSCG_TimeBombComment/ link http://msprogrammer.serviciipeweb.ro/category/roslyn/ author Andrei Ignat This will generate an error from the comment after a certain date   The code that you start with is The code that you will use is   The code that is generated is Example Code: https://github.com/ignatandrei/RSCG_Examples/tree/main/TimeBombComment

  • RSCG Example–ApparatusAOT–part 26

        name ApparatusAOT nuget https://www.nuget.org/packages/Apparatus.AOT.Reflection/ link https://github.com/byme8/Apparatus.AOT.Reflection author Stanislav Silin This will generate code for investigating at runtime the properties of an object   The code that you start with is The code that you will use is   The code that is generated is Example Code: https://github.com/ignatandrei/RSCG_Examples/tree/main/ApparatusAOT

  • RSCG Example–AppSettings editor–part 25

        name AppSettingsEditor nuget https://www.nuget.org/packages/appSettingsEditor/ link http://msprogrammer.serviciipeweb.ro/category/roslyn/ author Andrei Ignat This will generate classes code from appsettings . Additionally,it generates API controller for editing and an UI interface   The code that you start with is The code that you will use is   The code that is generated is Example Code: https://github.com/ignatandrei/RSCG_Examples/tree/main/appSettingsEditor

  • RSCG Example–Static To Interface–part 24

        name Static To Interface nuget https://www.nuget.org/packages/RSCG_Static/ link http://msprogrammer.serviciipeweb.ro/category/roslyn/ author Andrei Ignat This will generate code for any static properties of a class to generate interface,record and a class with real behaviour   The code that you start with is The code that you will use is   The code that is generated is…

  • RSCG Example – Tiny Types – Part 23

        name BaseTypes nuget https://www.nuget.org/packages/AndreasDorfer.BaseTypes/ link https://github.com/Andreas-Dorfer/base-types author Andreas Dorfer Generated tiny types from any value type   The code that you start with is The code that you will use is   The code that is generated is Example Code: https://github.com/ignatandrei/RSCG_Examples/tree/main/TinyTypes

  • RSCG Example–SourceInject- part 22

        name SourceInject nuget https://www.nuget.org/packages/SourceInject/ link https://github.com/giggio/sourceinject author Giovanni Bassi Auto register services in startup   The code that you start with is The code that you will use is    The code that is generated is Example Code: https://github.com/ignatandrei/RSCG_Examples/tree/main/AutoRegister