# dotnet/efcore

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/dotnet-efcore).**

14,587 stars · 3,365 forks · C# · mit

## Links

- GitHub: https://github.com/dotnet/efcore
- Homepage: https://learn.microsoft.com/ef/
- awesome-repositories: https://awesome-repositories.com/repository/dotnet-efcore.md

## Topics

`aspnet-product` `c-sharp` `database` `dotnet-core` `dotnet-framework` `dotnet-standard` `entity-framework` `hacktoberfest` `orm`

## Description

Entity Framework Core is an object-relational mapper that enables developers to interact with database systems using strongly-typed code. It serves as a comprehensive data access framework, providing a unified interface for mapping application objects to relational and non-relational database schemas while managing the lifecycle of data operations through a central context.

The project distinguishes itself through a provider-based architecture that decouples core data access logic from specific database engines, allowing for consistent interaction across diverse storage systems. It features a sophisticated query translation engine that converts language-integrated queries into optimized, database-specific commands, alongside a robust migration toolset that automates schema evolution by synchronizing the physical database structure with the application model.

Beyond its core mapping and query capabilities, the framework provides extensive tooling for database scaffolding, reverse engineering, and automated code generation. It supports complex data modeling requirements, including inheritance hierarchies, owned entity relationships, and custom mapping configurations, while offering built-in mechanisms for transaction management, concurrency control, and connection resiliency.

The framework includes comprehensive observability and testing utilities, such as command interception, operation logging, and in-memory database simulation for isolated testing. It is designed for integration with standard dependency injection containers and provides configuration hooks to customize scaffolding and migration logic.

## Tags

### Data & Databases

- [Object-Relational Mappers](https://awesome-repositories.com/f/data-databases/object-relational-mappers.md) — Provides a comprehensive framework for mapping application objects to relational and non-relational database schemas.
- [CRUD Interfaces](https://awesome-repositories.com/f/data-databases/database-record-management/crud-interfaces.md) — Executes create, read, update, and delete operations using strongly-typed object-oriented syntax. ([source](https://learn.microsoft.com/ef/core/modeling/data-seeding))
- [Object-Relational Mapping](https://awesome-repositories.com/f/data-databases/object-relational-mapping.md) — Maps application objects to database schemas to enable strongly-typed data persistence and retrieval.
- [Entity Mappings](https://awesome-repositories.com/f/data-databases/type-mapping-frameworks/script-to-native-type-mappings/entity-mappings.md) — Translates application objects into database tables and columns, allowing interaction with data using strongly-typed code. ([source](https://learn.microsoft.com/ef/core/querying/tracking))
- [Database Schema Migrations](https://awesome-repositories.com/f/data-databases/database-management-systems/database-systems-management/database-management/database-schema-migrations.md) — Automates incremental schema evolution to keep database structures synchronized with application models.
- [LINQ Expression Translators](https://awesome-repositories.com/f/data-databases/expression-based-data-querying/linq-expression-translators.md) — Converts language-integrated query expressions into optimized database-specific command trees for execution on the remote data store.
- [Entity Relationship Models](https://awesome-repositories.com/f/data-databases/object-relational-mappers/data-modeling/entity-relationship-models.md) — Links object references to database primary and foreign keys to synchronize state between application models and relational schemas. ([source](https://learn.microsoft.com/ef/core/managing-schemas/migrations/teams))
- [Asynchronous Database Command Execution](https://awesome-repositories.com/f/data-databases/asynchronous-database-command-execution.md) — Executes database operations through a non-blocking I/O stack to maintain application responsiveness and improve throughput.
- [Data Access Abstractions](https://awesome-repositories.com/f/data-databases/data-engineering-infrastructure/data-persistence-storage/data-storage/data-access-abstractions.md) — Provides a repository pattern to decouple application logic from database operations, enabling mock-based testing. ([source](https://learn.microsoft.com/ef/core/managing-schemas/scaffolding/))
- [Database Connectivity](https://awesome-repositories.com/f/data-databases/database-connectivity.md) — Connects to diverse relational and non-relational databases using a pluggable provider architecture. ([source](https://learn.microsoft.com/ef/core/providers/))
- [Retry Policies](https://awesome-repositories.com/f/data-databases/database-connectivity/retry-policies.md) — Automatically retries failed database commands to maintain stability during transient connection errors. ([source](https://learn.microsoft.com/ef/core/providers/sql-server/))
- [Database Query Optimizations](https://awesome-repositories.com/f/data-databases/database-management-systems/database-systems-management/performance-optimization-tools/database-query-optimizations.md) — Translates query logic into database-specific commands to minimize data transfer and leverage server-side performance. ([source](https://learn.microsoft.com/ef/core/modeling/keys))
- [Database Relationship Mappings](https://awesome-repositories.com/f/data-databases/database-relationship-mappings.md) — Maps complex database relationships like many-to-many associations into strongly-typed object models during the scaffolding process. ([source](https://learn.microsoft.com/ef/core/saving/async))
- [Database Transaction Management](https://awesome-repositories.com/f/data-databases/database-transaction-management.md) — Groups multiple database operations into a single atomic transaction to ensure data integrity and consistent state across complex object graphs.
- [Primary Keys](https://awesome-repositories.com/f/data-databases/entity-modeling/primary-keys.md) — Designates unique identifiers for entities to ensure records are distinct and referenceable. ([source](https://learn.microsoft.com/ef/efcore-and-ef6/))
- [Entity Relationships](https://awesome-repositories.com/f/data-databases/entity-relationships.md) — Modifies foreign key associations by updating navigation properties on tracked objects to point to different related entities. ([source](https://learn.microsoft.com/ef/))
- [SQLite Drivers](https://awesome-repositories.com/f/data-databases/sqlite-drivers.md) — Entity Framework maps application objects to relational tables and manages data operations to enable interaction with SQLite database engines. ([source](https://learn.microsoft.com/ef/core/providers/sqlite/))
- [Bulk Data Operations](https://awesome-repositories.com/f/data-databases/bulk-data-operations.md) — Performs direct database updates and deletions without loading entities into memory for improved performance. ([source](https://learn.microsoft.com/ef/core/saving/basic))
- [Column Mappings](https://awesome-repositories.com/f/data-databases/column-mappings.md) — Configures mapping of object properties to database columns, including data types, nullability, and collations. ([source](https://learn.microsoft.com/ef/core/managing-schemas/scaffolding/))
- [Concurrency Control](https://awesome-repositories.com/f/data-databases/concurrency-control.md) — Identifies data modifications by other processes using concurrency tokens to validate row state. ([source](https://learn.microsoft.com/ef/core/saving/concurrency))
- [LINQ Integration](https://awesome-repositories.com/f/data-databases/data-access-querying/data-access-abstraction/raw-sql-execution/linq-integration.md) — Wraps raw SQL queries as subqueries to allow further filtering, sorting, or projection using standard language-integrated query operators. ([source](https://learn.microsoft.com/ef/core/querying/raw-sql))
- [Persistent Filters](https://awesome-repositories.com/f/data-databases/data-query-filters/persistent-filters.md) — Attaches persistent filters to entity types that automatically restrict all database queries based on defined criteria. ([source](https://learn.microsoft.com/ef/core/querying/filters))
- [Data Type Mappings](https://awesome-repositories.com/f/data-databases/data-type-mappings.md) — Maps complex data structures, inheritance hierarchies, and custom types between application objects and database schemas. ([source](https://learn.microsoft.com/ef/core/managing-schemas/migrations/history-table))
- [Database Access Layers](https://awesome-repositories.com/f/data-databases/database-access-layers.md) — Automates the generation of entity models and context classes from existing database schemas.
- [Reverse Engineering Tools](https://awesome-repositories.com/f/data-databases/database-access-layers/reverse-engineering-tools.md) — Entity Framework generates code-based models and context classes by inspecting an existing database structure to bootstrap data access layers. ([source](https://learn.microsoft.com/ef/core/cli/))
- [Atomic Transactions](https://awesome-repositories.com/f/data-databases/database-management-systems/database-systems-management/connection-transaction-management/atomic-transactions.md) — Groups multiple data operations into atomic units of work to maintain data integrity. ([source](https://learn.microsoft.com/ef/core/saving/transactions))
- [Database Query Joins](https://awesome-repositories.com/f/data-databases/database-query-joins.md) — Connects data sources based on matching keys to generate combined results using relational joins. ([source](https://learn.microsoft.com/ef/core/modeling/))
- [Owned Entities](https://awesome-repositories.com/f/data-databases/entity-modeling/owned-entities.md) — Defines dependent entity types that are managed and persisted as a single aggregate unit with their owner. ([source](https://learn.microsoft.com/ef/core/managing-schemas/migrations/))
- [Cascade Deletions](https://awesome-repositories.com/f/data-databases/entity-relationships/cascade-deletions.md) — Configures relationships to automatically remove child records when a parent entity is deleted. ([source](https://learn.microsoft.com/ef/core/saving/cascade-delete))
- [Identity Maps](https://awesome-repositories.com/f/data-databases/entity-relationships/identity-maps.md) — Ensures that multiple references to the same database record point to a single object instance. ([source](https://learn.microsoft.com/ef/))
- [Relation Loading Strategies](https://awesome-repositories.com/f/data-databases/relation-loading-strategies.md) — Retrieves associated entities using eager, explicit, or lazy loading patterns to populate navigation properties. ([source](https://learn.microsoft.com/ef/core/querying/async))
- [Conflict Resolution](https://awesome-repositories.com/f/data-databases/conflict-resolution.md) — Provides mechanisms to resolve data collisions by accessing current, original, and database-stored values. ([source](https://learn.microsoft.com/ef/core/get-started/wpf))
- [Nullability Synchronization](https://awesome-repositories.com/f/data-databases/data-integrity-constraints/nullability-synchronization.md) — Ensures entity properties and database columns remain synchronized regarding nullability requirements. ([source](https://learn.microsoft.com/ef/core/modeling/relationships))
- [Filter Overrides](https://awesome-repositories.com/f/data-databases/data-query-filters/filter-overrides.md) — Disables active query filters for specific operations to allow access to restricted or hidden data. ([source](https://learn.microsoft.com/ef/core/saving/disconnected-entities))
- [Database Connection Managers](https://awesome-repositories.com/f/data-databases/database-connection-managers.md) — Manages database connections and entity tracking through a central context class. ([source](https://learn.microsoft.com/ef/core/get-started/winforms))
- [Database Integrations](https://awesome-repositories.com/f/data-databases/database-integrations.md) — Integrates various database platforms through a consistent programming interface and provider-based architecture.
- [Database Migration Management](https://awesome-repositories.com/f/data-databases/database-migration-management.md) — Organizes schema changes into distinct sets by associating migration histories with specific database providers or context configurations. ([source](https://learn.microsoft.com/ef/core/cli/))
- [Database Task Automation](https://awesome-repositories.com/f/data-databases/database-task-automation.md) — Provides command-line operations to generate migrations, scaffold models, and manage the lifecycle of database structures during development. ([source](https://learn.microsoft.com/ef/))
- [Ambient Transactions](https://awesome-repositories.com/f/data-databases/database-transactions/nested-transactions/ambient-transactions.md) — Enlists operations into shared transaction scopes that propagate automatically across asynchronous calls. ([source](https://learn.microsoft.com/ef/core/saving/transactions))
- [Retriable Transactions](https://awesome-repositories.com/f/data-databases/database-transactions/retriable-transactions.md) — Wraps multiple database operations within a single execution strategy block to ensure the entire group is replayed if a transient failure occurs. ([source](https://learn.microsoft.com/ef/core/saving/async))
- [Automatic Persistence](https://awesome-repositories.com/f/data-databases/entity-relationships/automatic-persistence.md) — Detects and saves new objects referenced through navigation properties automatically when the parent entity is added to the tracking context. ([source](https://learn.microsoft.com/ef/core/querying/user-defined-function-mapping))
- [Owned Collections](https://awesome-repositories.com/f/data-databases/entity-relationships/owned-collections.md) — Handles one-to-many relationships for owned types, automatically managing identity requirements. ([source](https://learn.microsoft.com/ef/core/saving/related-data))
- [Grouped Aggregations](https://awesome-repositories.com/f/data-databases/grouped-aggregations.md) — Groups query results by keys and applies scalar aggregate functions like sum or count. ([source](https://learn.microsoft.com/ef/core/cli/dotnet))
- [Multi-Database Connections](https://awesome-repositories.com/f/data-databases/multi-database-connections.md) — Manages multiple concurrent database connections and data sources within a single application. ([source](https://learn.microsoft.com/ef/efcore-and-ef6/))
- [Alternate Keys](https://awesome-repositories.com/f/data-databases/object-relational-mappers/data-modeling/entity-relationship-models/alternate-keys.md) — Establishes additional unique identifiers for entities to enforce uniqueness and support relational mapping. ([source](https://learn.microsoft.com/ef/))
- [Raw SQL Execution](https://awesome-repositories.com/f/data-databases/raw-sql-execution.md) — Runs custom SQL statements against a database to retrieve entity data or scalar values using parameterization. ([source](https://learn.microsoft.com/ef/core/saving/))
- [Context Lifecycle Managers](https://awesome-repositories.com/f/data-databases/repository-context-managers/context-lifecycle-managers.md) — Controls the creation and disposal of data access instances to ensure they align with specific application scopes or unit-of-work requirements. ([source](https://learn.microsoft.com/ef/core/dbcontext-configuration/))
- [Schema Migration Tools](https://awesome-repositories.com/f/data-databases/schema-migration-tools.md) — Creates specialized migration operations to decouple database logic from schema definitions. ([source](https://learn.microsoft.com/ef/core/saving/basic))
- [Database Compatibility Layers](https://awesome-repositories.com/f/data-databases/database-compatibility-layers.md) — Adjusts generated SQL syntax to match specific database engine versions for optimal compatibility. ([source](https://learn.microsoft.com/ef/core/providers/sql-server/))
- [Database Logging](https://awesome-repositories.com/f/data-databases/database-logging.md) — Captures and outputs internal database activity and execution details to logging providers for monitoring. ([source](https://learn.microsoft.com/ef/core/managing-schemas/))
- [Database Connection Configurations](https://awesome-repositories.com/f/data-databases/database-management-systems/database-systems-management/connection-transaction-management/database-connection-configurations.md) — Configures a data access context to connect to specific database providers and manage connection strings or provider-specific settings. ([source](https://learn.microsoft.com/ef/core/dbcontext-configuration/))
- [Database Performance Optimizers](https://awesome-repositories.com/f/data-databases/database-performance-optimizers.md) — Precompiles database models and queries to reduce startup time and improve execution speed. ([source](https://learn.microsoft.com/ef/efcore-and-ef6/))
- [Database Schema Managers](https://awesome-repositories.com/f/data-databases/database-schema-managers.md) — Provides utilities to programmatically create or drop database tables based on the application model for testing and development environments. ([source](https://learn.microsoft.com/ef/core/querying/tracking))
- [Database Transactions](https://awesome-repositories.com/f/data-databases/database-transactions.md) — Enforces database isolation levels to ensure data consistency and handle concurrency during transactions. ([source](https://learn.microsoft.com/ef/core/saving/concurrency))
- [Relationship Severing](https://awesome-repositories.com/f/data-databases/entity-relationships/relationship-severing.md) — Severs associations between entities by clearing navigation properties. ([source](https://learn.microsoft.com/ef/core/querying/user-defined-function-mapping))
- [Generated Columns](https://awesome-repositories.com/f/data-databases/generated-columns.md) — Supports database columns that automatically derive values from other columns or expressions. ([source](https://learn.microsoft.com/ef/core/modeling/generated-properties))
- [In-Memory Databases](https://awesome-repositories.com/f/data-databases/in-memory-databases.md) — Maintains a volatile, non-persistent data store in memory to facilitate automated testing without a live database. ([source](https://learn.microsoft.com/ef/dotnet-data/))
- [Join Operations](https://awesome-repositories.com/f/data-databases/join-operations.md) — Executes left join operations by identifying patterns to include records even when no matching inner data exists. ([source](https://learn.microsoft.com/ef/ef6/get-started))
- [Naming Conventions](https://awesome-repositories.com/f/data-databases/naming-conventions.md) — Extends or modifies default mapping heuristics to support custom naming and structural patterns. ([source](https://learn.microsoft.com/ef/dotnet-data/))
- [NoSQL Databases](https://awesome-repositories.com/f/data-databases/nosql-databases.md) — Provides secure connectivity and data access for document-based NoSQL database systems. ([source](https://learn.microsoft.com/ef/core/providers/cosmos/))
- [Metadata Inspection](https://awesome-repositories.com/f/data-databases/prepared-statements/metadata-inspection.md) — Retrieves information about configured database contexts and checks for pending model changes. ([source](https://learn.microsoft.com/ef/core/miscellaneous/connection-resiliency))
- [Result Streaming APIs](https://awesome-repositories.com/f/data-databases/result-streaming-apis.md) — Processes large datasets incrementally by returning an asynchronous enumerable for client-side composition. ([source](https://learn.microsoft.com/ef/core/get-started/winforms))
- [Schema Generation Utilities](https://awesome-repositories.com/f/data-databases/schema-generation-utilities.md) — Produces raw SQL commands required to create a database schema without executing them against the target database. ([source](https://learn.microsoft.com/ef/))
- [Keyless Entities](https://awesome-repositories.com/f/data-databases/type-mapping-frameworks/script-to-native-type-mappings/entity-mappings/keyless-entities.md) — Enables data retrieval from database views or tables that do not support primary keys. ([source](https://learn.microsoft.com/ef/core/managing-schemas/migrations/operations))

### Software Engineering & Architecture

- [Database Abstraction Layers](https://awesome-repositories.com/f/software-engineering-architecture/database-abstraction-layers.md) — Decouples core data access logic from specific database engines using pluggable drivers that implement engine-specific translation and connection handling.
- [Database Migration Tools](https://awesome-repositories.com/f/software-engineering-architecture/database-migration-tools.md) — Tracks and applies incremental schema changes to ensure database compatibility with application code.
- [Dependency Injection Containers](https://awesome-repositories.com/f/software-engineering-architecture/dependency-injection-containers.md) — Integrates with standard dependency injection containers to manage the lifecycle of data access contexts automatically. ([source](https://learn.microsoft.com/ef/core/dbcontext-configuration/))
- [Metadata Mapping](https://awesome-repositories.com/f/software-engineering-architecture/metadata-mapping.md) — Uses a central configuration model to define the relationship between application classes and database schemas through conventions or fluent definitions.
- [Scaffolding Generators](https://awesome-repositories.com/f/software-engineering-architecture/scaffolding-generators.md) — Generates entity classes and data access configurations by inspecting existing database schemas. ([source](https://learn.microsoft.com/ef/core/cli/powershell))
- [Development-Time Generators](https://awesome-repositories.com/f/software-engineering-architecture/code-generators/development-time-generators.md) — Automates the creation of migration scripts and model classes by inspecting database schemas during development.
- [Context Factories](https://awesome-repositories.com/f/software-engineering-architecture/application-lifecycle-management/configuration-management/configuration-scopes/application-configuration/application-factories/context-factories.md) — Provides factory-based instantiation for data access contexts when standard dependency injection scopes are insufficient. ([source](https://learn.microsoft.com/ef/core/dbcontext-configuration/))
- [Concurrency Tokens](https://awesome-repositories.com/f/software-engineering-architecture/concurrency-managers/concurrency-tokens.md) — Entity Framework configures specific properties to act as version markers, either by leveraging native database-generated values or by manually tracking state within the application code. ([source](https://learn.microsoft.com/ef/core/querying/raw-sql))
- [Database Value Generation](https://awesome-repositories.com/f/software-engineering-architecture/default-configuration-values/database-value-generation.md) — Configures properties to have values generated by the database or application logic during insertion or updates. ([source](https://learn.microsoft.com/ef/core/modeling/generated-properties))
- [Graph Traversal](https://awesome-repositories.com/f/software-engineering-architecture/entity-management/graph-traversal.md) — Traverses complex object hierarchies to apply tracking states to related data structures. ([source](https://learn.microsoft.com/ef/core/managing-schemas/ensure-created))

### Development Tools & Productivity

- [Entity Identity Maps](https://awesome-repositories.com/f/development-tools-productivity/change-tracking/entity-identity-maps.md) — Maintains a registry of loaded entity instances to ensure object consistency and detect modifications for automated persistence.
- [Entity Tracking](https://awesome-repositories.com/f/development-tools-productivity/change-tracking/entity-tracking.md) — Configures whether retrieved data is monitored for changes to enable automatic persistence. ([source](https://learn.microsoft.com/ef/core/miscellaneous/connection-resiliency))
- [Data Access Context Configurations](https://awesome-repositories.com/f/development-tools-productivity/global-application-contexts/context-exports/data-access-context-configurations.md) — Entity Framework automates the instantiation of data access objects by integrating with dependency injection containers or custom factory implementations during development. ([source](https://learn.microsoft.com/ef/core/cli/dbcontext-creation))
- [Database Schema Scripting](https://awesome-repositories.com/f/development-tools-productivity/automation-scripts/database-schema-scripting.md) — Entity Framework produces SQL scripts from model changes or migration ranges to facilitate manual or automated updates to the database schema. ([source](https://learn.microsoft.com/ef/core/cli/powershell))
- [Disconnected Persistence](https://awesome-repositories.com/f/development-tools-productivity/change-tracking/entity-tracking/disconnected-persistence.md) — Entity Framework synchronizes changes from detached objects to the database by determining whether to insert, update, or delete records based on their current state. ([source](https://learn.microsoft.com/ef/core/saving/transactions))
- [Database Command Interceptors](https://awesome-repositories.com/f/development-tools-productivity/data-interception-hooks/database-command-interceptors.md) — Inspects and modifies database commands before or after execution to provide hooks for logging or modification. ([source](https://learn.microsoft.com/ef/core/cli/dotnet))
- [Deployment Bundle Generators](https://awesome-repositories.com/f/development-tools-productivity/deployment-bundles/deployment-bundle-generators.md) — Packages database update logic into standalone executables to deploy schema changes across environments without requiring the full application runtime. ([source](https://learn.microsoft.com/ef/core/cli/dotnet))
- [Scaffolding Configuration](https://awesome-repositories.com/f/development-tools-productivity/scaffolding-configuration.md) — Allows customization of generated code by filtering tables, adjusting naming conventions, and organizing output files during scaffolding. ([source](https://learn.microsoft.com/ef/core/saving/disconnected-entities))

### Networking & Communication

- [SQL Server Connectors](https://awesome-repositories.com/f/networking-communication/database-connectivity/sql-server-connectors.md) — Entity Framework maps application objects to database tables and queries to enable interaction with SQL Server, Azure SQL, and Azure Synapse Analytics. ([source](https://learn.microsoft.com/ef/core/providers/sql-server/))

### DevOps & Infrastructure

- [Database Lifecycle Management](https://awesome-repositories.com/f/devops-infrastructure/database-lifecycle-management.md) — Drops or updates databases to specific migration states to maintain alignment with the application model. ([source](https://learn.microsoft.com/ef/core/saving/transactions))

### Programming Languages & Runtimes

- [Migration](https://awesome-repositories.com/f/programming-languages-runtimes/compiler-interpreter-internals/code-generators/migration.md) — Produces source code for schema changes and model snapshots to keep application models synchronized with the current database state. ([source](https://learn.microsoft.com/ef/core/cli/services))
