ASP.NET Core Dependency Injection – How to Register Generic Types Exploring how generic types can be registered with the built-in Microsoft DI container

If you find the information in this post useful and want to learn more about dependency injection, may I suggest viewing my new course on Pluralsight – “Dependency Injection in ASP.NET Core“? I dive deeply the Microsoft DI container and how to use all of its features in your applications. Since its release, ASP.NET Core […]

Read More

Using HostBuilder and the Generic Host in .NET Core Microservices Exploring a simple pattern for cross-cutting concerns in console based services.

NOTE: This content is now quite out of date. I have a new post “What are .NET Worker services?” which answers that question. Worker services are a much better alternative to the example below. I also cover them in detail in my new course on Pluralsight – “Building ASP.NET Core Hosted Services and .NET Core […]

Read More

ASP.NET Core Anatomy – How does UseStartup work? Exploring how UseStartup results in your Startup methods being registered and executed.

I was recently explaining to someone the basics of the program flow for an ASP.NET Core application. One of the things included in the templates for ASP.NET Core and used very often is the UseStartup<T> extension method on the IWebHostBuilder. This gets called from our Program.cs when initialising the application. UseStartup allows us to set […]

Read More