Skip to content

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.