Category: .NET
-
RSCG – polytype
RSCG – polytype name polytype nuget https://www.nuget.org/packages/polytype/ link https://github.com/eiriktsarpalis/PolyType author Eirik Tsarpalis Generating shape like reflection from classes. See PolyType.Examples for more details This is how you can use polytype . The code that you start with is The code that you will use is The code that is generated is…
-
RSCG – Datacute.EmbeddedResourcePropertyGenerator
RSCG – Datacute.EmbeddedResourcePropertyGenerator name Datacute.EmbeddedResourcePropertyGenerator nuget https://www.nuget.org/packages/Datacute.EmbeddedResourcePropertyGenerator/ link https://github.com/datacute/EmbeddedResourcePropertyGenerator/ author Stephen Denne Generating class to access easy the embedded resource This is how you can use Datacute.EmbeddedResourcePropertyGenerator . The code that you start with is The code that you will use is The code that is generated is Code and pdf…
-
RSCG – rscg_queryables
RSCG – rscg_queryables name rscg_queryables nuget https://www.nuget.org/packages/rscg_queryables/ https://www.nuget.org/packages/rscg_queryablesCommon/ link https://github.com/ignatandrei/rscg_queryables author Andrei Ignat Generating code for .Where and .OrderBy by string,not by lambda This is how you can use rscg_queryables . The code that you start with is The code that you will use is The code that is generated is…
-
Watch2–part7–full test
Watch2 NuGet Package The Watch2 NuGet package extends the functionality of dotnet watch by adding features such as console clearing and delay handling. It outputs the same information as dotnet watch. 1. Wrapper Interfaces To facilitate testing,it is necessary to wrap various process creation classes from .NET (e.g.,Process => ProcessWrapper,ProcessStartInfo => ProcessStartInfoWrapper). This allows for…
-
Watch2–part 6- options
The Watch2 package passes all the command line arguments to the dotnet watch. So how can it have its own settings? Simple: by reading a watch.json file that is in the same folder where it is executing. 1. Testing I was considering how to perform the testing,and there were two options: Microsoft File Providers: https://learn.microsoft.com/en-us/aspnet/core/fundamentals/file-providers?view=aspnetcore-8.0…
-
Watch2- part 5–DI
The Watch2 NuGet package project now has interfaces,making it test-friendly and ready for action. To make life easier,we’ve sprinkled some Dependency Injection (DI) magic throughout the project. Classes have been refactored to embrace constructor injection,ensuring all necessary interfaces are on board. The DI container has been set up in `Program.cs`,making dependency resolution a breeze. The…
-
Watch2–part 4–CI and CD
Now I want to do build and auto-deployment as a Nuget Package( at https://www.nuget.org/packages/watch2 ) The most simple build action on GitHub Actions is simple example of how to do it. However,I want to do more than that. I want to build,test and deploy on demand the Nuget package to Nuget.org. However,the building should be…
-
Watch2- part 3 -refactoring to interfaces and test
The Watch2 just intercepts the dotnet watch,adds a clear console,and a delay to give a breather between running the app and the tests. So I need to have tests – if I want to be sure what the software does and to modify it without summoning the coding gremlins. More importantly,the output from dotnet watch…
-
Watch2- part 2- first fast implementation
The first attempt to writing the code was very fast – and,surely,not testable. (Speedy Gonzales would be proud!) Some observations: 1. If you start any process inside a console application,you should intercept the cancel signal and stop the process. This is done by using the CancelKeyPress event of the Console class. This is important because…
-
Watch2–part 1–idea
I frequently use .NET Watch for two main reasons: Running .NET applications during development. Executing tests. Seriously,if you haven’t tried .NET Watch,you’re missing out. It’s like having a personal assistant who never sleeps compiling code . For more info,check out Microsoft’s documentation at https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-watch But,like all good things,it comes with a couple of quirks: The…