In this video we dissect ASP.NET Core service lifetimes using a 100% practical approach. We first look into the behavior of the different lifetimes by registering the same service with different lifetimes and checking the output of the service. We then tackle important topics like how ASP.NET Core service lifetimes affect the way we inject services in custom middleware. Last but not least we look into some common errors we could run into when not understanding correctly how service lifetimes are designed to work.
Injecting scoped services into singleton services: • ASP.Net Core: How to i...
#aspnetcore #dependencyInjection #dotnet
21 сен 2024