A lightweight, extensible, open source and cross-platform version of Entity Framework
open sourceMITself-hostablefree
Entity Framework Core (EF Core) is Microsoft's object-relational mapper for .NET: you work with a database through entity classes and a DbContext, query it with LINQ, and save changes by modifying objects, without writing most data access code. Models can be hand-coded or generated from an existing database, and EF Migrations create and evolve the schema as the model changes. Database providers cover SQL Server and Azure SQL, SQLite, Azure Cosmos DB and an in-memory database from Microsoft, with PostgreSQL (Npgsql), MySQL and MariaDB, Oracle, MongoDB and others from their makers. It's the usual data layer for ASP.NET Core apps, cross-platform and MIT licensed.
Problems it solves
- query and save database data from C# using objects instead of hand-written SQL
- write type-safe database queries in C# with LINQ
- create and evolve my database schema from my .NET model with migrations
- generate C# entity classes from an existing SQL Server or PostgreSQL database
- use the same data access code with SQL Server, PostgreSQL, MySQL or SQLite
- add a data layer to an ASP.NET Core web API
- test .NET data access code against an in-memory or SQLite database
Features
- DbContext and entity classes as the model
- LINQ queries translated to SQL
- change tracking and saving through entity instances
- migrations to create and evolve the database schema
- reverse engineering (scaffolding) a model from an existing database
- Microsoft providers for SQL Server, Azure SQL, SQLite, Azure Cosmos DB and in-memory
- third-party providers for PostgreSQL, MySQL, MariaDB, Oracle, MongoDB, Couchbase and more
- cross-platform on Windows, Linux and macOS
Capabilities
| Takes plugins | plan not known |
|---|
Alternatives
The same job
These do what Entity Framework Core does.
- sqlc Compile SQL to type-safe code
