EF Core architecture

EF Core architecture

The following diagram depicts the architecture behind EF Core.

The DbContext is a special class that represents a unit of work and provides methods to configure options, connection strings, logging, and the model used to map your domain to the database.

Classes deriving from DbContext:

  • Represent an active session with the database.

  • Save and query instances of entities.

  • Include properties of type DbSet<T> representing tables in the database.

The EF Core Provider translates object graph changes to SQL.

The Database Provider:

  • Is a plug-in library designed for a specific database engine, such as SQL Server, Azure Cosmos DB, or PostgreSQL.

  • Translates method calls and LINQ queries to the database's native SQL dialect.

  • Extends EF Core to enable functionality that's unique to the database engine.

Last updated