What is service lifetimes in ASP.NET Core?
Loading
What is service lifetimes in ASP.NET Core?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Amit MohantyPosted Aug 8, 2022, 6:04 AM
1 - Transient
2 - Scoped
3 - Singleton
For more details check the below links.
https://www.dotnettricks.com/learn/dependencyinjection/implementation-asp-net-core-mvc
https://code-maze.com/dependency-injection-lifetimes-aspnet-core/
Vishal YelvePosted Aug 7, 2022, 9:24 AM
There are three lifetimes that can be used with Microsoft Dependency Injection Container, they are:
Vishal JoshiPosted Aug 7, 2022, 8:11 AM
Service lifetimes available in .NET Core:
We can register these services with the AddTransient(), AddScoped() and AddSingleton() methods respectively.
Rajanikant HawaldarPosted Aug 7, 2022, 5:43 AM
They are services, which will be used and integrated using depedency injection, There are 3 types of lifetimes supported by ASP.NET Core for the dependency injection,They are,
1)Transient Service
2)Scoped Service
3)Singleton Service
https://www.c-sharpcorner.com/article/service-lifetime-dependency-injection-asp-net-core/