Microsoft.EntityFrameworkCore 8.0.20

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

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
HotChocolate.Data.EntityFramework
Contains extensions for seamless integration of Entity Framework Core into HotChocolate
5,203
Microsoft.EntityFrameworkCore.Proxies
Lazy loading proxies for Entity Framework Core.
4,966
Microsoft.EntityFrameworkCore.Relational
Shared Entity Framework Core components for relational database providers.
4,958
Microsoft.EntityFrameworkCore.Relational
Shared Entity Framework Core components for relational database providers.
1,615
HotChocolate.Data.EntityFramework
Contains extensions for seamless integration of Entity Framework Core into HotChocolate
511
Microsoft.EntityFrameworkCore.Proxies
Lazy loading proxies for Entity Framework Core.
509
Microsoft.EntityFrameworkCore.Relational
Shared Entity Framework Core components for relational database providers.
503
Microsoft.EntityFrameworkCore.Proxies
Lazy loading proxies for Entity Framework Core.
297
Microsoft.EntityFrameworkCore.Relational
Shared Entity Framework Core components for relational database providers.
292
Microsoft.EntityFrameworkCore.InMemory
In-memory database provider for Entity Framework Core (to be used for testing purposes).
99
Ardalis.Specification.EntityFrameworkCore
EF Core plugin package to Ardalis.Specification containing EF Core evaluator and abstract repository.
80
AspNetCore.HealthChecks.UI.Core
HealthChecks.UI.Core package containing builder and model definitions
76
Ardalis.Specification.EntityFrameworkCore
EF Core plugin package to Ardalis.Specification containing EF Core evaluator and abstract repository.
74
Microsoft.EntityFrameworkCore.Relational
Shared Entity Framework Core components for relational database providers.
74
Microsoft.EntityFrameworkCore.InMemory
In-memory database provider for Entity Framework Core (to be used for testing purposes).
72
Microsoft.EntityFrameworkCore.Proxies
Lazy-loading proxies for EF Core. This package was built from the source at: https://github.com/aspnet/EntityFramework.git/tree/cbd2a2074d908673195abbb14de5a460acaa2aea
72
Microsoft.EntityFrameworkCore.Relational
Shared Entity Framework Core components for relational database providers.
69
Microsoft.EntityFrameworkCore.Proxies
Lazy loading proxies for Entity Framework Core.
68
Ardalis.Specification.EntityFrameworkCore
EF Core plugin package to Ardalis.Specification containing EF Core evaluator and abstract repository.
68
Microsoft.EntityFrameworkCore.Proxies
Lazy-loading proxies for EF Core.
67

Version Downloads Last updated
10.0.0-rc.2.25502.107 4 10/15/2025
10.0.0-rc.1.25451.107 8 09/13/2025
10.0.0-preview.7.25380.108 9 08/14/2025
10.0.0-preview.6.25358.103 14 07/16/2025
10.0.0-preview.5.25277.114 23 06/14/2025
10.0.0-preview.4.25258.110 17 05/13/2025
10.0.0-preview.3.25171.6 21 04/11/2025
10.0.0-preview.2.25163.8 26 03/25/2025
10.0.0-preview.1.25081.1 31 02/26/2025
9.0.10 2 10/16/2025
9.0.9 7 09/11/2025
9.0.8 17 08/06/2025
9.0.7 11 07/11/2025
9.0.6 25 06/12/2025
9.0.5 17 05/16/2025
9.0.4 23 04/12/2025
9.0.3 26 03/14/2025
9.0.2 25 02/13/2025
9.0.1 31 01/17/2025
9.0.0 38 11/13/2024
9.0.0-rc.2.24474.1 39 10/16/2024
9.0.0-rc.1.24451.1 41 09/10/2024
9.0.0-preview.7.24405.3 40 08/15/2024
9.0.0-preview.6.24327.4 49 07/10/2024
9.0.0-preview.5.24306.3 45 06/12/2024
9.0.0-preview.4.24267.1 39 05/24/2024
9.0.0-preview.3.24172.4 37 04/13/2024
9.0.0-preview.2.24128.4 46 03/21/2024
9.0.0-preview.1.24081.2 43 02/18/2024
8.0.21 3 10/15/2025
8.0.20 9 09/10/2025
8.0.19 16 08/06/2025
8.0.18 12 07/12/2025
8.0.17 17 06/12/2025
8.0.16 21 05/15/2025
8.0.15 24 04/10/2025
8.0.14 28 03/14/2025
8.0.13 27 02/13/2025
8.0.12 30 01/20/2025
8.0.11 30 11/13/2024
8.0.10 38 10/12/2024
8.0.8 37 08/15/2024
8.0.7 41 07/14/2024
8.0.6 38 05/29/2024
8.0.5 36 05/15/2024
8.0.4 44 04/11/2024
8.0.3 43 03/13/2024
8.0.2 4,967 02/17/2024
8.0.1 298 01/17/2024
8.0.0 5,198 11/14/2023
8.0.0-rc.2.23480.1 46 10/10/2023
8.0.0-rc.1.23419.6 55 09/14/2023
8.0.0-preview.7.23375.4 59 08/25/2023
8.0.0-preview.6.23329.4 59 07/12/2023
8.0.0-preview.5.23280.1 57 06/20/2023
8.0.0-preview.4.23259.3 54 05/18/2023
8.0.0-preview.3.23174.2 66 04/28/2023
8.0.0-preview.2.23128.3 511 04/03/2023
8.0.0-preview.1.23111.4 54 06/29/2023
7.0.20 39 05/29/2024
7.0.19 41 05/15/2024
7.0.18 49 04/11/2024
7.0.17 55 03/13/2024
7.0.16 48 02/17/2024
7.0.15 52 02/05/2024
7.0.14 47 11/17/2023
7.0.13 52 10/24/2023
7.0.12 55 10/10/2023
7.0.11 59 09/14/2023
7.0.10 52 08/19/2023
7.0.9 56 07/25/2023
7.0.8 54 07/06/2023
7.0.7 49 06/20/2023
7.0.5 62 04/28/2023
7.0.4 51 05/18/2023
7.0.3 67 03/09/2023
7.0.2 60 01/26/2023
7.0.1 69 12/17/2022
7.0.0 519 11/15/2022
7.0.0-rc.2.22472.11 60 11/20/2022
7.0.0-rc.1.22426.7 59 06/27/2023
7.0.0-preview.7.22376.2 68 09/25/2022
7.0.0-preview.6.22329.4 54 11/20/2022
7.0.0-preview.5.22302.2 53 06/29/2023
7.0.0-preview.4.22229.2 56 06/28/2023
7.0.0-preview.3.22175.1 60 05/06/2022
7.0.0-preview.2.22153.1 65 05/28/2022
7.0.0-preview.1.22076.6 50 03/01/2022
6.0.36 36 11/13/2024
6.0.35 32 10/12/2024
6.0.33 43 08/15/2024
6.0.32 47 07/10/2024
6.0.31 39 05/29/2024
6.0.30 43 05/15/2024
6.0.29 39 04/11/2024
6.0.28 42 03/19/2024
6.0.27 43 02/17/2024
6.0.26 44 01/21/2024
6.0.25 51 11/17/2023
6.0.24 45 10/24/2023
6.0.23 52 10/10/2023
6.0.22 54 09/14/2023
6.0.21 48 08/23/2023
6.0.20 46 07/26/2023
6.0.19 57 07/11/2023
6.0.18 46 07/05/2023
6.0.16 60 04/28/2023
6.0.15 50 07/02/2023
6.0.14 60 06/05/2023
6.0.13 58 07/01/2023
6.0.12 57 06/29/2023
6.0.11 55 11/28/2022
6.0.10 67 10/14/2022
6.0.9 47 10/10/2022
6.0.8 51 08/30/2022
6.0.7 59 07/21/2022
6.0.6 72 07/12/2022
6.0.5 61 05/25/2022
6.0.4 56 12/22/2022
6.0.3 79 03/09/2022
6.0.2 70 02/11/2022
6.0.1 80 12/20/2021
6.0.0 71 11/09/2021
6.0.0-rc.2.21480.5 46 06/15/2023
6.0.0-rc.1.21452.10 50 05/16/2022
6.0.0-preview.7.21378.4 63 06/13/2022
6.0.0-preview.6.21352.1 50 05/10/2022
6.0.0-preview.5.21301.9 67 11/15/2022
6.0.0-preview.4.21253.1 64 05/18/2022
6.0.0-preview.3.21201.2 53 08/24/2022
6.0.0-preview.2.21154.2 52 05/10/2022
6.0.0-preview.1.21102.2 55 06/24/2023
5.0.17 46 06/29/2023
5.0.16 58 11/02/2022
5.0.15 68 05/11/2022
5.0.14 53 07/17/2022
5.0.13 49 06/30/2023
5.0.12 61 05/19/2022
5.0.11 59 10/22/2021
5.0.10 74 09/24/2021
5.0.9 70 07/02/2023
5.0.8 60 07/19/2021
5.0.7 86 07/09/2021
5.0.6 67 05/28/2022
5.0.5 55 04/18/2023
5.0.4 53 04/06/2021
5.0.3 226 02/15/2021
5.0.2 189 01/26/2021
5.0.1 57 07/03/2022
5.0.0 57 10/26/2022
5.0.0-rc.2.20475.6 50 06/20/2022
5.0.0-rc.1.20451.13 51 06/28/2023
5.0.0-preview.8.20407.4 57 05/27/2022
5.0.0-preview.7.20365.15 60 05/10/2022
5.0.0-preview.6.20312.4 58 06/28/2023
5.0.0-preview.5.20278.2 51 06/29/2023
5.0.0-preview.4.20220.10 56 06/06/2022
5.0.0-preview.3.20181.2 64 10/06/2022
5.0.0-preview.2.20159.4 57 06/30/2023
5.0.0-preview.2.20120.8 51 06/04/2022
3.1.32 43 07/01/2023
3.1.31 49 12/02/2022
3.1.30 51 06/29/2023
3.1.29 58 01/13/2023
3.1.28 56 05/15/2023
3.1.27 50 06/24/2023
3.1.26 58 09/14/2022
3.1.25 45 06/29/2023
3.1.24 51 12/25/2022
3.1.23 47 05/15/2023
3.1.22 46 06/14/2023
3.1.21 67 06/02/2022
3.1.20 47 06/23/2023
3.1.19 46 06/27/2023
3.1.18 43 06/30/2023
3.1.17 53 10/25/2022
3.1.16 52 05/20/2022
3.1.15 57 09/28/2022
3.1.14 56 12/24/2021
3.1.13 50 10/16/2022
3.1.12 53 06/19/2022
3.1.11 57 05/10/2022
3.1.10 51 02/04/2023
3.1.9 62 05/16/2022
3.1.8 59 05/19/2022
3.1.7 130 11/09/2020
3.1.6 70 11/02/2022
3.1.5 47 06/15/2023
3.1.4 54 06/24/2023
3.1.3 52 05/09/2022
3.1.2 53 06/03/2022
3.1.1 58 08/03/2022
3.1.0 54 05/15/2023
3.1.0-preview3.19554.8 59 06/23/2022
3.1.0-preview2.19525.5 59 11/29/2022
3.1.0-preview1.19506.2 56 06/28/2023
3.0.3 78 11/05/2022
3.0.2 52 06/22/2022
3.0.1 45 06/29/2023
3.0.0 57 05/11/2022
3.0.0-rc1.19456.14 57 07/03/2022
3.0.0-preview9.19423.6 59 06/27/2022
3.0.0-preview8.19405.11 50 06/28/2023
3.0.0-preview7.19362.6 60 06/27/2023
3.0.0-preview6.19304.10 50 07/16/2022
3.0.0-preview5.19227.1 66 05/16/2022
3.0.0-preview4.19216.3 60 06/28/2023
3.0.0-preview3.19153.1 58 06/27/2022
3.0.0-preview.19074.3 56 06/29/2023
3.0.0-preview.18572.1 52 05/10/2022
2.3.0 20 01/17/2025
2.2.6 56 11/22/2021
2.2.4 63 12/26/2022
2.2.3 68 06/04/2022
2.2.2 50 12/03/2022
2.2.1 79 06/17/2022
2.2.0 67 05/09/2022
2.2.0-preview3-35497 51 05/27/2022
2.2.0-preview2-35157 56 06/28/2023
2.2.0-preview1-35029 53 06/29/2023
2.1.14 48 06/29/2023
2.1.11 65 05/23/2022
2.1.8 46 06/28/2023
2.1.4 55 04/03/2023
2.1.3 48 05/10/2023
2.1.2 52 06/24/2023
2.1.1 56 02/22/2023
2.1.0 56 11/15/2022
2.1.0-rc1-final 46 05/10/2022
2.1.0-preview2-final 75 05/31/2022
2.1.0-preview1-final 51 05/16/2022
2.0.3 49 11/03/2022
2.0.2 57 06/29/2023
2.0.1 50 05/17/2022
2.0.0 55 05/20/2022
2.0.0-preview2-final 51 06/27/2023
2.0.0-preview1-final 60 05/10/2022
1.1.6 53 05/09/2022
1.1.5 53 02/21/2023
1.1.4 46 05/15/2023
1.1.3 67 05/22/2022
1.1.2 53 10/03/2022
1.1.1 59 11/11/2022
1.1.0 52 12/16/2022
1.1.0-preview1-final 52 12/21/2022
1.0.6 61 12/31/2022
1.0.5 51 05/30/2022
1.0.4 53 02/21/2023
1.0.3 57 10/17/2022
1.0.2 46 01/16/2023
1.0.1 57 11/28/2022
1.0.0 60 01/22/2023
1.0.0-rc2-final 49 05/14/2023