scoped lifetime

A service lifetime in which one instance is shared within a scope, which in ASP.NET Core means one HTTP request, then disposed.

In more detail

A DbContext is scoped so that one request's changes form one unit of work. Never inject a scoped service into a singleton.

Related terms

Taught in

References