MediumConcept.NET
Explain dependency injection lifetimes in ASP.NET Core.
What a good answer covers
Transient creates a new instance each time, scoped one per request, and singleton one for the application. Injecting a scoped service into a singleton is a bug because it captures a stale instance.
PreviousWhat is the difference between value types and reference types in C#?Next What do async and await do in C#?