Hosting DI Container with .NET Core 3.0

Hosting DI Container with .NET Core 3.0

ASP.NET Core included the WebHost class that was used in the Main method to startup everything up – including the … Continue reading Hosting DI Container with .NET Core 3.0

Disposing Injected Services (or: Using Dependency Injection Scopes)

Disposing Injected Services (or: Using Dependency Injection Scopes)

The DI container Microsoft.Extensions.DependencyInjection disposes registered services automatically. It’s just the question when the dispose takes place. Automatic dispose of transient and scoped services happen at the end of a scope. With ASP.NET Core applications, scopes are created with every HTTP request – after the request, services are disposed. This article shows creating and using DI scopes with XAML-based applications. Continue reading Disposing Injected Services (or: Using Dependency Injection Scopes)