DbContext

The EF Core class that represents a session with the database: it tracks entities, translates queries and saves changes as one unit of work.

In more detail

It owns a connection and a change tracker, so it is disposable and registered with a scoped lifetime, one per request. It receives its settings through DbContextOptions from dependency injection.

Related terms

Taught in

References