Category: roslyn
-
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…
-
AOPMethods–dogfooding
I was trying to apply AOPMethods to – surprise! – AOPMethods project itself. And I have discovered a new reason: I do not want to make the methods public. I just want to put try/catch around them to know what is wrong. The fast – and not so good – idea was to transform MethodPrefix…
-
AOP Methods–Problems in running and solving
The problems that I have encountered were: 1. The ThisAssembly RoslynGenerator that I use should not be put as reference in the nuget. I have fixed this by adding <PackageReference Include=”ThisAssembly.AssemblyInfo” Version=”1.0.0″ ReferenceOutputAssembly=”false” /> 2. I have problems generating code to async code with Task . The problem was that I have added logging (…