Mid ASP.NET Core

Different service lifetimes: Transient, Scoped, Singleton?

Lifetime Description Use Case Example

Transient New instance every time Lightweight stateless

services

Scoped One instance per request Database context, UoW

Singleto

One instance for the app's

lifetime

Logging, Config access

More from ASP.NET Core Tutorial

All questions for this course