Category: .NET Core
-
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
-
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…
-
AOPMethods–adding partial functions and enums
I was finishing the AOPMethods – and what I have been thinking is – why not add partial functions ? I have added Console.Write,but … this seems more general… So,now,this is the Person class definition with the partial function definition [AutoMethods(template = TemplateMethod.MethodWithPartial,MethodPrefix =”pub”,MethodSuffix =”bup”)] partial class Person { partial void Method_Start(string methodName) { Console.WriteLine($”start…