Tutorials

.NET Core Tutorial: Using the ServiceCollection Extension Pattern II: Pass options using the Options Pattern

In a previous post I demonstrated how to use to ServiceCollection Extension Pattern and how this prevents a bloated ConfigureServices() pipeline. In this follow up you will learn how to pass additional information to your implementation. Consider the following extension method that adds your project containing some services: As seen in the previous post, we … Continue reading .NET Core Tutorial: Using the ServiceCollection Extension Pattern II: Pass options using the Options Pattern

.NET Core Tutorial: Using the ServiceCollection Extension Pattern

If you have worked on applications (in .NET Core) you should know how Dependency Injection (DI) is supported and is applied for your services. This is straight forward and not so hard at all. Just add them to the IServiceCollection in the ConfigureServices() pipeline in the startup.cs file. Considering a N-Tier architrecture, where our Startup.cs … Continue reading .NET Core Tutorial: Using the ServiceCollection Extension Pattern

T4 Beginner Tutorial: Generate C# classes based on text definitions

Introduction T4 stands for Text Template Transformation Toolkit. When you scaffold a controller or view in ASP.NET, in the background T4 Templates that contain those structures are executed and files are generated for you. In this article I will explain how you can generate classes yourself, based on simple definitions in a text file. This … Continue reading T4 Beginner Tutorial: Generate C# classes based on text definitions