Microsoft.EntityFrameworkCore 9.0.0
Entity Framework Core (EF Core) is a modern object-database mapper that lets you build a clean, portable, and high-level data access layer with .NET (C#) across a variety of databases, including SQL Server (on-premises and Azure), SQLite, MySQL, PostgreSQL, Oracle, and Azure Cosmos DB. It supports LINQ queries, change tracking, updates, and schema migrations.
Getting started
Prerequisites
Make sure to install the same version of all EF Core packages shipped by Microsoft. For example, if version 5.0.3 of Microsoft.EntityFrameworkCore.SqlServer is installed, then all other Microsoft.EntityFrameworkCore.* packages must also be at 5.0.3.
Usage
To use Microsoft.EntityFrameworkCore in your application, you will typically need to create a class that inherits from DbContext, which represents your database session. You can then define classes that represent your database entities, and use LINQ queries to interact with the database.
Here's an example of how you might define a database context and an entity:
using Microsoft.EntityFrameworkCore;
public class MyDbContext : DbContext
{
public DbSet<Customer> Customers { get; set; }
}
public class Customer
{
public int Id { get; set; }
public string Name { get; set; }
}
You can then use the MyDbContext class to interact with the database:
using var context = new MyDbContext();
// Add a new customer
context.Customers.Add(new Customer { Name = "John Doe" });
context.SaveChanges();
// Retrieve all customers
var customers = context.Customers.ToList();
Microsoft.EntityFrameworkCore supports multiple database providers, including SQL Server, MySQL, PostgreSQL, SQLite, and others. You will need to install the provider package for your chosen database. For example, to use SQL Server, you would install the Microsoft.EntityFrameworkCore.SqlServer package.
You would then configure your database context to use the SQL Server provider:
using Microsoft.EntityFrameworkCore;
public class MyDbContext : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder options)
=> options.UseSqlServer(@"Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=MyDatabase");
public DbSet<Customer> Customers { get; set; }
}
public class Customer
{
public int Id { get; set; }
public string Name { get; set; }
}
Additional documentation
- Getting Started with Entity Framework Core.
- Follow the ASP.NET Core Tutorial to use EF Core in a web app.
- Releases and planning(roadmap)
- How to write an EF Core provider
Feedback
If you have a specific question about using these projects, we encourage you to ask it on Stack Overflow. If you encounter a bug or would like to request a feature, submit an Github issue. For more details, see getting support.
Showing the top 20 packages that depend on Microsoft.EntityFrameworkCore.
| Packages | Downloads |
|---|---|
|
Ding.TimedJob
Ding.TimedJob是基于.net core平台开发的应用框架中的NetCore定时任务类库。
|
6 |
|
DotNetCore.CAP.PostgreSql
Distributed transaction solution in micro-service base on eventually consistency, also an eventbus with Outbox pattern.
|
5 |
|
DotNetCore.CAP.SqlServer
EventBus and eventually consistency in distributed architectures.
|
5 |
|
Microsoft.VisualStudio.Web.CodeGeneration.Design
Code Generation tool for ASP.NET Core. Contains the dotnet-aspnet-codegenerator command used for generating controllers and views.
|
5 |
|
Microsoft.EntityFrameworkCore.Relational
Shared Entity Framework Core components for relational database providers.
|
5 |
|
Microsoft.EntityFrameworkCore.Proxies
Lazy loading proxies for Entity Framework Core.
|
4 |
|
DotNetCore.CAP.SqlServer
EventBus and eventually consistency in distributed architectures.
|
4 |
|
Ding
Ding是基于.net core平台开发的应用框架中的NetCore核心类库。
|
4 |
|
Ding.TimedJob
Ding.TimedJob是基于.net core平台开发的应用框架中的NetCore定时任务类库。
|
4 |
|
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
|
4 |
|
Microsoft.EntityFrameworkCore.Relational
Shared Entity Framework Core components for relational database providers.
|
4 |
|
DotNetCore.CAP.PostgreSql
Distributed transaction solution in micro-service base on eventually consistency, also an eventbus with Outbox pattern.
|
4 |
.NET 8.0
- Microsoft.EntityFrameworkCore.Abstractions (>= 9.0.0)
- Microsoft.EntityFrameworkCore.Analyzers (>= 9.0.0)
- Microsoft.Extensions.Caching.Memory (>= 9.0.0)
- Microsoft.Extensions.Logging (>= 9.0.0)
| Version | Downloads | Last updated |
|---|---|---|
| 10.0.1 | 1 | 2025/12/19 |
| 10.0.0 | 4 | 2025/11/19 |
| 10.0.0-rc.2.25502.107 | 0 | 2025/10/14 |
| 10.0.0-rc.1.25451.107 | 4 | 2025/10/30 |
| 10.0.0-preview.7.25380.108 | 0 | 2025/8/12 |
| 10.0.0-preview.6.25358.103 | 0 | 2025/7/15 |
| 10.0.0-preview.5.25277.114 | 0 | 2025/6/6 |
| 10.0.0-preview.4.25258.110 | 0 | 2025/5/12 |
| 10.0.0-preview.3.25171.6 | 0 | 2025/4/10 |
| 10.0.0-preview.2.25163.8 | 0 | 2025/3/18 |
| 10.0.0-preview.1.25081.1 | 0 | 2025/2/25 |
| 9.0.11 | 1 | 2025/11/19 |
| 9.0.10 | 0 | 2025/10/14 |
| 9.0.9 | 1 | 2025/11/19 |
| 9.0.8 | 2 | 2025/8/29 |
| 9.0.7 | 2 | 2025/8/29 |
| 9.0.6 | 2 | 2025/8/29 |
| 9.0.5 | 2 | 2025/8/29 |
| 9.0.4 | 2 | 2025/8/29 |
| 9.0.3 | 2 | 2025/8/29 |
| 9.0.2 | 2 | 2025/8/29 |
| 9.0.1 | 2 | 2025/8/29 |
| 9.0.0 | 3 | 2025/8/29 |
| 9.0.0-rc.2.24474.1 | 0 | 2024/10/8 |
| 9.0.0-rc.1.24451.1 | 0 | 2024/9/10 |
| 9.0.0-preview.7.24405.3 | 0 | 2024/8/13 |
| 9.0.0-preview.6.24327.4 | 0 | 2024/7/9 |
| 9.0.0-preview.5.24306.3 | 0 | 2024/6/11 |
| 9.0.0-preview.4.24267.1 | 0 | 2024/5/21 |
| 9.0.0-preview.3.24172.4 | 0 | 2024/4/11 |
| 9.0.0-preview.2.24128.4 | 0 | 2024/3/12 |
| 9.0.0-preview.1.24081.2 | 0 | 2024/2/13 |
| 8.0.22 | 1 | 2025/11/19 |
| 8.0.21 | 0 | 2025/10/14 |
| 8.0.20 | 0 | 2025/9/9 |
| 8.0.19 | 0 | 2025/8/5 |
| 8.0.18 | 0 | 2025/7/8 |
| 8.0.17 | 0 | 2025/6/10 |
| 8.0.16 | 0 | 2025/5/13 |
| 8.0.15 | 0 | 2025/4/8 |
| 8.0.14 | 0 | 2025/3/11 |
| 8.0.13 | 0 | 2025/2/11 |
| 8.0.12 | 0 | 2025/1/14 |
| 8.0.11 | 0 | 2024/11/12 |
| 8.0.10 | 0 | 2024/10/8 |
| 8.0.8 | 2 | 2025/8/29 |
| 8.0.7 | 1 | 2025/8/29 |
| 8.0.6 | 2 | 2025/8/29 |
| 8.0.5 | 3 | 2025/6/10 |
| 8.0.4 | 2 | 2025/8/29 |
| 8.0.3 | 2 | 2025/8/29 |
| 8.0.2 | 2 | 2025/8/29 |
| 8.0.1 | 2 | 2025/8/29 |
| 8.0.0 | 2 | 2025/8/29 |
| 8.0.0-rc.2.23480.1 | 0 | 2023/10/10 |
| 8.0.0-rc.1.23419.6 | 0 | 2023/9/12 |
| 8.0.0-preview.7.23375.4 | 0 | 2023/8/8 |
| 8.0.0-preview.6.23329.4 | 0 | 2023/7/11 |
| 8.0.0-preview.5.23280.1 | 0 | 2023/6/13 |
| 8.0.0-preview.4.23259.3 | 0 | 2023/5/16 |
| 8.0.0-preview.3.23174.2 | 0 | 2023/4/11 |
| 8.0.0-preview.2.23128.3 | 0 | 2023/3/14 |
| 8.0.0-preview.1.23111.4 | 0 | 2023/2/21 |
| 7.0.20 | 0 | 2024/5/28 |
| 7.0.19 | 0 | 2024/5/14 |
| 7.0.18 | 0 | 2024/4/9 |
| 7.0.17 | 0 | 2024/3/12 |
| 7.0.16 | 0 | 2024/2/13 |
| 7.0.15 | 0 | 2024/1/9 |
| 7.0.14 | 0 | 2023/11/14 |
| 7.0.13 | 0 | 2023/10/24 |
| 7.0.12 | 0 | 2023/10/10 |
| 7.0.11 | 0 | 2023/9/12 |
| 7.0.10 | 0 | 2023/8/8 |
| 7.0.9 | 2 | 2025/8/29 |
| 7.0.8 | 2 | 2025/8/29 |
| 7.0.7 | 2 | 2025/8/29 |
| 7.0.5 | 2 | 2025/8/29 |
| 7.0.4 | 2 | 2025/8/29 |
| 7.0.3 | 2 | 2025/8/29 |
| 7.0.2 | 3 | 2025/8/29 |
| 7.0.1 | 2 | 2025/8/29 |
| 7.0.0 | 2 | 2025/8/29 |
| 7.0.0-rc.2.22472.11 | 0 | 2022/10/11 |
| 7.0.0-rc.1.22426.7 | 0 | 2022/9/14 |
| 7.0.0-preview.7.22376.2 | 0 | 2022/8/9 |
| 7.0.0-preview.6.22329.4 | 0 | 2022/7/12 |
| 7.0.0-preview.5.22302.2 | 0 | 2022/6/14 |
| 7.0.0-preview.4.22229.2 | 0 | 2022/5/10 |
| 7.0.0-preview.3.22175.1 | 0 | 2022/4/13 |
| 7.0.0-preview.2.22153.1 | 0 | 2022/3/14 |
| 7.0.0-preview.1.22076.6 | 0 | 2022/2/17 |
| 6.0.36 | 0 | 2024/11/12 |
| 6.0.35 | 0 | 2024/10/8 |
| 6.0.33 | 0 | 2024/8/13 |
| 6.0.32 | 0 | 2024/7/9 |
| 6.0.31 | 0 | 2024/5/28 |
| 6.0.30 | 0 | 2024/5/14 |
| 6.0.29 | 0 | 2024/4/9 |
| 6.0.28 | 0 | 2024/3/12 |
| 6.0.27 | 0 | 2024/2/13 |
| 6.0.26 | 0 | 2024/1/9 |
| 6.0.25 | 0 | 2023/11/14 |
| 6.0.24 | 0 | 2023/10/24 |
| 6.0.23 | 0 | 2023/10/10 |
| 6.0.22 | 0 | 2023/9/12 |
| 6.0.21 | 0 | 2023/8/8 |
| 6.0.20 | 0 | 2023/7/11 |
| 6.0.19 | 0 | 2023/6/22 |
| 6.0.18 | 0 | 2023/6/13 |
| 6.0.16 | 0 | 2023/4/11 |
| 6.0.15 | 0 | 2023/3/14 |
| 6.0.14 | 0 | 2023/2/14 |
| 6.0.13 | 0 | 2023/1/10 |
| 6.0.12 | 0 | 2022/12/13 |
| 6.0.11 | 0 | 2022/11/7 |
| 6.0.10 | 0 | 2022/10/11 |
| 6.0.9 | 2 | 2025/8/29 |
| 6.0.8 | 2 | 2025/8/29 |
| 6.0.7 | 2 | 2025/8/29 |
| 6.0.6 | 2 | 2025/8/29 |
| 6.0.5 | 2 | 2025/8/29 |
| 6.0.4 | 2 | 2025/8/29 |
| 6.0.3 | 2 | 2025/8/29 |
| 6.0.2 | 2 | 2025/8/29 |
| 6.0.1 | 2 | 2025/8/29 |
| 6.0.0 | 4 | 2025/6/21 |
| 6.0.0-rc.2.21480.5 | 0 | 2021/10/12 |
| 6.0.0-rc.1.21452.10 | 0 | 2021/9/14 |
| 6.0.0-preview.7.21378.4 | 0 | 2021/8/10 |
| 6.0.0-preview.6.21352.1 | 0 | 2021/7/14 |
| 6.0.0-preview.5.21301.9 | 0 | 2021/6/15 |
| 6.0.0-preview.4.21253.1 | 0 | 2021/5/24 |
| 6.0.0-preview.3.21201.2 | 0 | 2021/4/8 |
| 6.0.0-preview.2.21154.2 | 0 | 2021/3/11 |
| 6.0.0-preview.1.21102.2 | 0 | 2021/2/12 |
| 5.0.17 | 1 | 2025/8/21 |
| 5.0.16 | 0 | 2022/4/11 |
| 5.0.15 | 0 | 2022/3/8 |
| 5.0.14 | 0 | 2022/2/8 |
| 5.0.13 | 0 | 2021/12/14 |
| 5.0.12 | 0 | 2021/11/7 |
| 5.0.11 | 0 | 2021/10/12 |
| 5.0.10 | 0 | 2021/9/14 |
| 5.0.9 | 2 | 2025/8/29 |
| 5.0.8 | 2 | 2025/8/29 |
| 5.0.7 | 2 | 2025/8/29 |
| 5.0.6 | 2 | 2025/8/29 |
| 5.0.5 | 2 | 2025/8/29 |
| 5.0.4 | 2 | 2025/8/29 |
| 5.0.3 | 2 | 2025/8/29 |
| 5.0.2 | 2 | 2025/8/29 |
| 5.0.1 | 2 | 2025/8/29 |
| 5.0.0 | 2 | 2025/8/29 |
| 5.0.0-rc.2.20475.6 | 0 | 2020/10/13 |
| 5.0.0-rc.1.20451.13 | 0 | 2020/9/14 |
| 5.0.0-preview.8.20407.4 | 0 | 2020/8/25 |
| 5.0.0-preview.7.20365.15 | 0 | 2020/7/21 |
| 5.0.0-preview.6.20312.4 | 0 | 2020/6/25 |
| 5.0.0-preview.5.20278.2 | 0 | 2020/6/10 |
| 5.0.0-preview.4.20220.10 | 0 | 2020/5/18 |
| 5.0.0-preview.3.20181.2 | 0 | 2020/4/23 |
| 5.0.0-preview.2.20159.4 | 0 | 2020/4/2 |
| 5.0.0-preview.2.20120.8 | 0 | 2020/3/16 |
| 3.1.32 | 0 | 2022/12/13 |
| 3.1.31 | 0 | 2022/11/8 |
| 3.1.30 | 0 | 2022/10/11 |
| 3.1.29 | 0 | 2022/9/13 |
| 3.1.28 | 0 | 2022/8/9 |
| 3.1.27 | 0 | 2022/7/12 |
| 3.1.26 | 0 | 2022/6/14 |
| 3.1.25 | 0 | 2022/5/10 |
| 3.1.24 | 0 | 2022/4/11 |
| 3.1.23 | 0 | 2022/3/8 |
| 3.1.22 | 0 | 2021/12/14 |
| 3.1.21 | 0 | 2021/11/7 |
| 3.1.20 | 0 | 2021/10/11 |
| 3.1.19 | 0 | 2021/9/14 |
| 3.1.18 | 0 | 2021/8/10 |
| 3.1.17 | 0 | 2021/7/13 |
| 3.1.16 | 0 | 2021/6/8 |
| 3.1.15 | 0 | 2021/5/11 |
| 3.1.14 | 0 | 2021/4/6 |
| 3.1.13 | 0 | 2021/3/9 |
| 3.1.12 | 0 | 2021/2/9 |
| 3.1.11 | 0 | 2021/1/12 |
| 3.1.10 | 0 | 2020/11/9 |
| 3.1.9 | 2 | 2025/8/29 |
| 3.1.8 | 2 | 2025/8/29 |
| 3.1.7 | 2 | 2025/8/29 |
| 3.1.6 | 2 | 2025/8/29 |
| 3.1.5 | 2 | 2025/8/29 |
| 3.1.4 | 2 | 2025/8/29 |
| 3.1.3 | 2 | 2025/8/29 |
| 3.1.2 | 2 | 2025/8/29 |
| 3.1.1 | 2 | 2025/8/29 |
| 3.1.0 | 4 | 2025/6/3 |
| 3.1.0-preview3.19554.8 | 1 | 2025/6/3 |
| 3.1.0-preview2.19525.5 | 0 | 2019/11/1 |
| 3.1.0-preview1.19506.2 | 0 | 2019/10/15 |
| 3.0.3 | 2 | 2025/8/29 |
| 3.0.2 | 2 | 2025/8/29 |
| 3.0.1 | 2 | 2025/8/29 |
| 3.0.0 | 2 | 2025/8/29 |
| 3.0.0-rc1.19456.14 | 0 | 2019/9/16 |
| 3.0.0-preview9.19423.6 | 0 | 2019/9/4 |
| 3.0.0-preview8.19405.11 | 0 | 2019/8/13 |
| 3.0.0-preview7.19362.6 | 0 | 2019/7/23 |
| 3.0.0-preview6.19304.10 | 0 | 2019/6/12 |
| 3.0.0-preview5.19227.1 | 0 | 2019/5/6 |
| 3.0.0-preview4.19216.3 | 0 | 2019/4/18 |
| 3.0.0-preview3.19153.1 | 0 | 2019/3/6 |
| 3.0.0-preview.19074.3 | 0 | 2019/1/29 |
| 3.0.0-preview.18572.1 | 0 | 2018/12/3 |
| 2.3.0 | 2 | 2025/8/29 |
| 2.2.6 | 3 | 2025/8/29 |
| 2.2.4 | 2 | 2025/8/29 |
| 2.2.3 | 2 | 2025/8/29 |
| 2.2.2 | 2 | 2025/8/29 |
| 2.2.1 | 2 | 2025/8/29 |
| 2.2.0 | 2 | 2025/8/29 |
| 2.2.0-preview3-35497 | 0 | 2018/10/17 |
| 2.2.0-preview2-35157 | 0 | 2018/9/12 |
| 2.2.0-preview1-35029 | 0 | 2018/8/22 |
| 2.1.14 | 0 | 2019/11/18 |
| 2.1.11 | 0 | 2019/5/14 |
| 2.1.8 | 2 | 2025/8/29 |
| 2.1.4 | 2 | 2025/8/29 |
| 2.1.3 | 2 | 2025/8/29 |
| 2.1.2 | 2 | 2025/8/29 |
| 2.1.1 | 2 | 2025/8/29 |
| 2.1.0 | 3 | 2025/8/21 |
| 2.1.0-rc1-final | 0 | 2018/5/6 |
| 2.1.0-preview2-final | 0 | 2018/4/10 |
| 2.1.0-preview1-final | 0 | 2018/2/26 |
| 2.0.3 | 2 | 2025/8/29 |
| 2.0.2 | 2 | 2025/8/29 |
| 2.0.1 | 2 | 2025/8/29 |
| 2.0.0 | 2 | 2025/8/29 |
| 2.0.0-preview2-final | 0 | 2017/6/28 |
| 2.0.0-preview1-final | 0 | 2017/5/10 |
| 1.1.6 | 2 | 2025/8/29 |
| 1.1.5 | 2 | 2025/8/29 |
| 1.1.4 | 2 | 2025/8/29 |
| 1.1.3 | 2 | 2025/8/29 |
| 1.1.2 | 2 | 2025/8/29 |
| 1.1.1 | 2 | 2025/8/29 |
| 1.1.0 | 2 | 2025/8/29 |
| 1.1.0-preview1-final | 0 | 2016/10/24 |
| 1.0.6 | 2 | 2025/8/29 |
| 1.0.5 | 2 | 2025/8/29 |
| 1.0.4 | 2 | 2025/8/29 |
| 1.0.3 | 2 | 2025/8/29 |
| 1.0.2 | 2 | 2025/8/29 |
| 1.0.1 | 2 | 2025/8/29 |
| 1.0.0 | 2 | 2025/8/29 |
| 1.0.0-rc2-final | 0 | 2016/5/16 |