Category: roslyn

  • RSGC- Dynamic Mock – part 10

        name MockSourceGenerator nuget https://www.nuget.org/packages/MockSourceGenerator/ link https://github.com/hermanussen/MockSourceGenerator/ author Robin Hermanussen This will generate Mock classes directly for any interface – with your implementation.   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/DynamicMocking

  • RSGC- MetadataFromObject – part 9

        name Metadata from object 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 generate code to retrieve the values of properties directly,not by reflection   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/MetadataFromObject

  • RSGC-Builder Design Pattern – part 8

        name data-builder-generator nuget https://www.nuget.org/packages/DasMulli.DataBuilderGenerator/ link https://github.com/dasMulli/data-builder-generator author Martin Andreas Ulrich Implements the Builder Design pattern for any class. Useful,at least,for test projects   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/DP_Builder

  • RSGC – Skinny Controllers- part 7

        name Skinny Controllers nuget https://www.nuget.org/packages/SkinnyControllersCommon/ https://www.nuget.org/packages/SkinnyControllersGenerator/ link http://msprogrammer.serviciipeweb.ro/category/roslyn/ author Andrei Ignat This will generate code for WebAPI for each method of a field in the controller   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/SkinnyControllers

  • RSGC – DTO Mapper – part 6

        name GeneratedMapper nuget https://www.nuget.org/packages/GeneratedMapper/ link https://github.com/ThomasBleijendaal/GeneratedMapper author Thomas Bleijendaal AutoMapping from a POCO to a DTO. Lots of customizations   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/DTOMapper

  • RSGC-Constructor – Deconstructor – part 5

        name CopyConstructor + Deconstructor 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 generate code for a POCO to generate copy constructor and deconstructor   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/CopyConstructor

  • RSGC-JSON to Class- part 4

        name JsonByExampleGenerator nuget https://www.nuget.org/packages/JsonByExampleGenerator/ link https://github.com/hermanussen/JsonByExampleGenerator/ author Robin Hermanussen This will generate C# classes from json files.   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/JsonToClass

  • RSGC-Enum-part 3

        name Enum 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 generate code to fast parsing a int or a string to an enum   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/Enum

  • RSCG- AppVersion–part 2

        name ThisAssembly nuget https://www.nuget.org/packages/ThisAssembly link https://www.clarius.org/ThisAssembly/ author Daniel Cazzulino The ThisAssembly.Info allows you access to the Assembly Information as constants,instead of going to reflection each time. I found useful to see the assembly version right away in any project that I have.   The code that you start with is in .csproj <PropertyGroup>…

  • RSCG–part 1

    Roslyn Source Code Generators are a easy way to generate automatically code that can be injected at compile time. This code can be generated on some template file or based on existing code or both . It works by intercepting at compile time the result of compilation of the existing source code and adding to…