Microsoft.EntityFrameworkCore 10.0.1

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
Microsoft.VisualStudio.Web.CodeGeneration.EntityFrameworkCore
Contains Entity Framework Core Services used by ASP.NET Core Code Generators.
121
Microsoft.EntityFrameworkCore.Relational
Shared Entity Framework Core components for relational database providers.
119
Microsoft.VisualStudio.Web.CodeGeneration.EntityFrameworkCore
Contains Entity Framework Core Services used by ASP.NET Core Code Generators.
119
Microsoft.EntityFrameworkCore.Relational
Shared Entity Framework Core components for relational database providers.
116
Microsoft.VisualStudio.Web.CodeGeneration.EntityFrameworkCore
Contains Entity Framework Core Services used by ASP.NET Core Code Generators.
115
Microsoft.EntityFrameworkCore.Relational
Shared Entity Framework Core components for relational database providers.
114
Microsoft.EntityFrameworkCore.Relational
Shared Entity Framework Core components for relational database providers.
113
Microsoft.EntityFrameworkCore.Relational
Shared Entity Framework Core components for relational database providers.
112
Microsoft.EntityFrameworkCore.Relational
Shared Entity Framework Core components for relational database providers.
111
Microsoft.VisualStudio.Web.CodeGeneration.EntityFrameworkCore
Contains Entity Framework Core Services used by ASP.NET Core Code Generators.
111
Microsoft.EntityFrameworkCore.Relational
Shared Entity Framework Core components for relational database providers. This package was built from the source code at https://github.com/aspnet/EntityFrameworkCore/tree/7cd2eb79628a2511af8e8d2699c29380909ab004
110
Microsoft.EntityFrameworkCore.Relational
Shared Entity Framework Core components for relational database providers.
110
Microsoft.VisualStudio.Web.CodeGeneration.EntityFrameworkCore
Contains Entity Framework Core Services used by ASP.NET Core Code Generators.
108
Microsoft.EntityFrameworkCore.Relational
Shared Entity Framework Core components for relational database providers. This package was built from the source at: https://github.com/aspnet/EntityFramework.git/tree/50b2296dfa89108dc7a5fcfea9537d978994f456
107
Microsoft.VisualStudio.Web.CodeGeneration.EntityFrameworkCore
Contains Entity Framework Core Services used by ASP.NET Core Code Generators.
107
Microsoft.EntityFrameworkCore.Relational
Shared Entity Framework Core components for relational database providers.
107

Version Downloads Last updated
10.0.1 5 12/10/2025
10.0.0 25 11/12/2025
10.0.0-rc.2.25502.107 39 10/15/2025
10.0.0-rc.1.25451.107 50 9/10/2025
10.0.0-preview.7.25380.108 48 8/12/2025
10.0.0-preview.6.25358.103 59 7/15/2025
10.0.0-preview.5.25277.114 48 6/8/2025
10.0.0-preview.4.25258.110 73 5/16/2025
10.0.0-preview.3.25171.6 59 4/12/2025
10.0.0-preview.2.25163.8 63 3/18/2025
10.0.0-preview.1.25081.1 64 2/28/2025
9.0.11 23 11/12/2025
9.0.10 38 10/15/2025
9.0.9 56 9/10/2025
9.0.8 49 8/5/2025
9.0.7 66 7/11/2025
9.0.6 67 6/15/2025
9.0.5 62 5/17/2025
9.0.4 69 4/8/2025
9.0.3 81 3/13/2025
9.0.2 82 2/15/2025
9.0.1 89 1/18/2025
9.0.0 82 11/12/2024
9.0.0-rc.2.24474.1 79 10/11/2024
9.0.0-rc.1.24451.1 73 9/11/2024
9.0.0-preview.7.24405.3 79 8/14/2024
9.0.0-preview.6.24327.4 79 7/10/2024
9.0.0-preview.5.24306.3 98 6/14/2024
9.0.0-preview.4.24267.1 78 5/25/2024
9.0.0-preview.3.24172.4 76 4/14/2024
9.0.0-preview.2.24128.4 85 3/21/2024
9.0.0-preview.1.24081.2 87 2/21/2024
8.0.22 20 11/12/2025
8.0.21 37 10/15/2025
8.0.20 44 9/10/2025
8.0.19 38 8/6/2025
8.0.18 61 7/11/2025
8.0.17 57 6/15/2025
8.0.16 61 5/17/2025
8.0.15 63 4/9/2025
8.0.14 61 3/13/2025
8.0.13 59 2/20/2025
8.0.12 68 1/18/2025
8.0.11 77 11/13/2024
8.0.10 89 10/12/2024
8.0.8 69 8/13/2024
8.0.7 84 7/9/2024
8.0.6 84 5/29/2024
8.0.5 79 5/23/2024
8.0.4 77 4/10/2024
8.0.3 98 3/20/2024
8.0.2 87 2/22/2024
8.0.1 89 1/11/2024
8.0.0 90 11/15/2023
8.0.0-rc.2.23480.1 99 10/13/2023
8.0.0-rc.1.23419.6 104 9/15/2023
8.0.0-preview.7.23375.4 99 8/22/2023
8.0.0-preview.6.23329.4 98 7/31/2023
8.0.0-preview.5.23280.1 100 7/31/2023
8.0.0-preview.4.23259.3 105 5/20/2023
8.0.0-preview.3.23174.2 96 5/14/2023
8.0.0-preview.2.23128.3 105 7/31/2023
8.0.0-preview.1.23111.4 125 2/23/2023
7.0.20 75 5/29/2024
7.0.19 77 5/23/2024
7.0.18 88 4/10/2024
7.0.17 89 3/20/2024
7.0.16 87 2/22/2024
7.0.15 78 1/15/2024
7.0.14 100 11/15/2023
7.0.13 91 10/28/2023
7.0.12 90 10/10/2023
7.0.11 82 9/16/2023
7.0.10 96 8/20/2023
7.0.9 106 7/31/2023
7.0.8 93 7/31/2023
7.0.7 99 7/31/2023
7.0.5 97 5/12/2023
7.0.4 95 5/12/2023
7.0.3 88 2/21/2023
7.0.2 84 2/21/2023
7.0.1 120 2/14/2023
7.0.0 100 12/3/2022
7.0.0-rc.2.22472.11 101 11/9/2022
7.0.0-rc.1.22426.7 105 9/15/2022
7.0.0-preview.7.22376.2 83 9/11/2022
7.0.0-preview.6.22329.4 102 9/14/2022
7.0.0-preview.5.22302.2 116 6/27/2022
7.0.0-preview.4.22229.2 110 6/30/2022
7.0.0-preview.3.22175.1 112 6/30/2022
7.0.0-preview.2.22153.1 106 6/30/2022
7.0.0-preview.1.22076.6 105 6/30/2022
6.0.36 73 11/13/2024
6.0.35 78 10/11/2024
6.0.33 80 8/14/2024
6.0.32 90 7/9/2024
6.0.31 83 5/29/2024
6.0.30 87 5/19/2024
6.0.29 91 4/10/2024
6.0.28 92 3/20/2024
6.0.27 89 2/22/2024
6.0.26 77 1/15/2024
6.0.25 93 11/16/2023
6.0.24 83 10/28/2023
6.0.23 93 10/10/2023
6.0.22 92 9/17/2023
6.0.21 86 8/22/2023
6.0.20 90 7/31/2023
6.0.19 105 7/31/2023
6.0.18 96 7/31/2023
6.0.16 105 5/12/2023
6.0.15 97 3/16/2023
6.0.14 90 2/21/2023
6.0.13 106 2/9/2023
6.0.12 106 12/30/2022
6.0.11 99 12/3/2022
6.0.10 92 12/3/2022
6.0.9 98 9/14/2022
6.0.8 95 9/14/2022
6.0.7 137 7/26/2022
6.0.6 99 6/30/2022
6.0.5 93 6/30/2022
6.0.4 87 6/30/2022
6.0.3 97 6/30/2022
6.0.2 98 6/30/2022
6.0.1 86 6/30/2022
6.0.0 120 6/30/2022
6.0.0-rc.2.21480.5 107 6/30/2022
6.0.0-rc.1.21452.10 103 6/30/2022
6.0.0-preview.7.21378.4 115 6/30/2022
6.0.0-preview.6.21352.1 98 6/30/2022
6.0.0-preview.5.21301.9 131 6/30/2022
6.0.0-preview.4.21253.1 103 6/30/2022
6.0.0-preview.3.21201.2 98 6/30/2022
6.0.0-preview.2.21154.2 103 6/30/2022
6.0.0-preview.1.21102.2 113 6/30/2022
5.0.17 108 6/30/2022
5.0.16 103 6/30/2022
5.0.15 125 6/30/2022
5.0.14 106 6/30/2022
5.0.13 101 6/30/2022
5.0.12 100 6/30/2022
5.0.11 100 6/30/2022
5.0.10 120 6/30/2022
5.0.9 118 6/30/2022
5.0.8 90 6/30/2022
5.0.7 113 6/30/2022
5.0.6 97 6/30/2022
5.0.5 101 6/30/2022
5.0.4 101 6/30/2022
5.0.3 94 6/30/2022
5.0.2 93 6/30/2022
5.0.1 106 6/30/2022
5.0.0 98 6/30/2022
5.0.0-rc.2.20475.6 89 6/30/2022
5.0.0-rc.1.20451.13 119 6/30/2022
5.0.0-preview.8.20407.4 106 6/30/2022
5.0.0-preview.7.20365.15 96 6/30/2022
5.0.0-preview.6.20312.4 127 6/30/2022
5.0.0-preview.5.20278.2 99 6/30/2022
5.0.0-preview.4.20220.10 90 6/30/2022
5.0.0-preview.3.20181.2 90 6/30/2022
5.0.0-preview.2.20159.4 88 6/30/2022
5.0.0-preview.2.20120.8 100 6/30/2022
3.1.32 106 2/1/2023
3.1.31 93 12/3/2022
3.1.30 103 11/7/2022
3.1.29 96 9/14/2022
3.1.28 104 9/14/2022
3.1.27 95 9/14/2022
3.1.26 95 6/30/2022
3.1.25 90 6/30/2022
3.1.24 98 6/30/2022
3.1.23 104 6/30/2022
3.1.22 97 6/30/2022
3.1.21 92 6/30/2022
3.1.20 93 6/30/2022
3.1.19 94 6/30/2022
3.1.18 93 6/30/2022
3.1.17 108 6/30/2022
3.1.16 96 6/30/2022
3.1.15 90 6/30/2022
3.1.14 103 6/30/2022
3.1.13 115 6/30/2022
3.1.12 92 6/30/2022
3.1.11 101 6/30/2022
3.1.10 87 6/30/2022
3.1.9 95 6/30/2022
3.1.8 95 6/30/2022
3.1.7 95 6/30/2022
3.1.6 106 6/30/2022
3.1.5 89 6/30/2022
3.1.4 106 6/30/2022
3.1.3 98 6/30/2022
3.1.2 98 6/30/2022
3.1.1 98 6/30/2022
3.1.0 115 6/30/2022
3.1.0-preview3.19554.8 104 6/30/2022
3.1.0-preview2.19525.5 103 6/30/2022
3.1.0-preview1.19506.2 93 6/30/2022
3.0.3 93 6/30/2022
3.0.2 111 6/30/2022
3.0.1 106 6/30/2022
3.0.0 110 6/30/2022
3.0.0-rc1.19456.14 124 6/30/2022
3.0.0-preview9.19423.6 107 6/30/2022
3.0.0-preview8.19405.11 100 6/30/2022
3.0.0-preview7.19362.6 112 6/30/2022
3.0.0-preview6.19304.10 116 6/30/2022
3.0.0-preview5.19227.1 88 6/30/2022
3.0.0-preview4.19216.3 98 6/30/2022
3.0.0-preview3.19153.1 107 6/30/2022
3.0.0-preview.19074.3 102 6/30/2022
3.0.0-preview.18572.1 104 6/30/2022
2.3.0 81 1/21/2025
2.2.6 90 6/30/2022
2.2.4 100 6/30/2022
2.2.3 111 6/30/2022
2.2.2 89 6/30/2022
2.2.1 117 6/30/2022
2.2.0 95 6/30/2022
2.2.0-preview3-35497 112 6/30/2022
2.2.0-preview2-35157 110 6/30/2022
2.2.0-preview1-35029 124 6/30/2022
2.1.14 88 6/30/2022
2.1.11 117 6/30/2022
2.1.8 119 6/30/2022
2.1.4 92 6/30/2022
2.1.3 90 6/30/2022
2.1.2 129 6/30/2022
2.1.1 90 6/30/2022
2.1.0 118 6/30/2022
2.1.0-rc1-final 93 6/30/2022
2.1.0-preview2-final 100 6/30/2022
2.1.0-preview1-final 106 6/30/2022
2.0.3 92 6/30/2022
2.0.2 95 6/30/2022
2.0.1 99 6/30/2022
2.0.0 97 6/30/2022
2.0.0-preview2-final 94 6/30/2022
2.0.0-preview1-final 108 6/30/2022
1.1.6 94 6/30/2022
1.1.5 118 6/30/2022
1.1.4 111 6/30/2022
1.1.3 102 6/30/2022
1.1.2 105 6/30/2022
1.1.1 125 6/30/2022
1.1.0 100 6/30/2022
1.1.0-preview1-final 94 6/30/2022
1.0.6 118 6/30/2022
1.0.5 97 6/30/2022
1.0.4 89 6/30/2022
1.0.3 99 6/30/2022
1.0.2 102 6/30/2022
1.0.1 101 6/30/2022
1.0.0 118 6/30/2022
1.0.0-rc2-final 96 6/30/2022