Microsoft.EntityFrameworkCore 9.0.22

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.EntityFrameworkCore.Relational
Shared Entity Framework Core components for relational database providers.
2,049
Microsoft.EntityFrameworkCore.Proxies
Lazy loading proxies for Entity Framework Core.
2,045
GreenDonut.Data.EntityFramework
This package provides data integrations like pagination, projections, filtering and sorting.
2,042
HotChocolate.Data.EntityFramework
Contains extensions for seamless integration of Entity Framework Core into HotChocolate
2,040
Ardalis.SmartEnum.EFCore
EFCore support for Ardalis.SmartEnum.
1,447
Microsoft.EntityFrameworkCore.Relational
Shared Entity Framework Core components for relational database providers.
184
Microsoft.EntityFrameworkCore.Relational
Shared Entity Framework Core components for relational database providers.
172
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
142
Microsoft.EntityFrameworkCore.Relational
Shared Entity Framework Core components for relational database providers.
122
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
114
Microsoft.EntityFrameworkCore.Relational
Shared Entity Framework Core components for relational database providers.
99
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
93
EFCore.NamingConventions
Naming Conventions for Entity Framework Core Tables and Columns.
88
Microsoft.EntityFrameworkCore.Relational
Shared Entity Framework Core components for relational database providers.
81
Gridify.EntityFramework
Gridify (EntityFramework), Easy and optimized way to apply Filtering, Sorting, and Pagination using text-based data.
71
Abp.EntityFrameworkCore
Abp.EntityFrameworkCore
69
HotChocolate.Data.EntityFramework.Helpers
Provides helper classes to implement cursor paging in a layered architecture without the need to reference HotChocolate GraphQL libraries.
68
Microsoft.VisualStudio.Web.CodeGenerators.Mvc
Code Generators for ASP.NET Core MVC. Contains code generators for MVC Controllers and Views.
67
EFCore.BulkExtensions
EntityFramework EF Core Bulk Batch Extensions for Insert Update Delete and Read (CRUD) operations on SQL Server, PostgreSQL and SQLite
64
Abp.EntityFrameworkCore
Abp.EntityFrameworkCore
64

Version Downloads Last updated
11.0.0-rc.3.26522.148 7 10/27/2026
11.0.0-rc.2.26504.105 10 10/13/2026
11.0.0-rc.1.26425.128 24 09/12/2026
11.0.0-preview.7.26381.103 23 08/12/2026
11.0.0-preview.6.26359.118 27 07/15/2026
11.0.0-preview.5.26302.115 27 06/10/2026
11.0.0-preview.4.26230.115 27 05/13/2026
11.0.0-preview.3.26207.106 47 04/16/2026
11.0.0-preview.2.26159.112 38 03/14/2026
11.0.0-preview.1.26104.118 39 02/12/2026
10.0.14 8 10/27/2026
10.0.13 12 10/14/2026
10.0.12 18 09/11/2026
10.0.11 158 08/12/2026
10.0.10 28 07/15/2026
10.0.9 26 06/10/2026
10.0.8 42 05/13/2026
10.0.7 2,043 04/23/2026
10.0.6 47 04/16/2026
10.0.5 91 03/13/2026
10.0.4 176 03/14/2026
10.0.3 41 02/13/2026
10.0.2 54 01/13/2026
10.0.1 2 10/03/2026
10.0.0 65 12/11/2025
10.0.0-rc.2.25502.107 48 12/17/2025
10.0.0-rc.1.25451.107 38 12/12/2025
10.0.0-preview.7.25380.108 35 12/16/2025
10.0.0-preview.6.25358.103 37 12/19/2025
10.0.0-preview.5.25277.114 5 09/28/2026
10.0.0-preview.4.25258.110 40 12/17/2025
10.0.0-preview.3.25171.6 38 12/14/2025
10.0.0-preview.2.25163.8 37 12/15/2025
10.0.0-preview.1.25081.1 4 10/02/2026
9.0.22 7 10/27/2026
9.0.21 11 10/13/2026
9.0.20 23 09/11/2026
9.0.19 21 08/12/2026
9.0.18 26 07/15/2026
9.0.17 21 06/10/2026
9.0.16 33 05/13/2026
9.0.15 47 04/16/2026
9.0.14 37 03/14/2026
9.0.13 39 02/13/2026
9.0.12 46 01/13/2026
9.0.11 45 12/14/2025
9.0.10 43 12/16/2025
9.0.9 37 12/12/2025
9.0.8 39 12/12/2025
9.0.7 41 12/19/2025
9.0.6 50 12/15/2025
9.0.5 47 12/16/2025
9.0.4 62 12/14/2025
9.0.3 50 12/11/2025
9.0.2 2,043 12/14/2025
9.0.1 36 12/15/2025
9.0.0 29 12/13/2025
9.0.0-rc.2.24474.1 29 12/23/2025
9.0.0-rc.1.24451.1 55 12/14/2025
9.0.0-preview.7.24405.3 32 12/14/2025
9.0.0-preview.6.24327.4 2 09/29/2026
9.0.0-preview.5.24306.3 34 12/18/2025
9.0.0-preview.4.24267.1 34 12/15/2025
9.0.0-preview.3.24172.4 4 10/07/2026
9.0.0-preview.2.24128.4 34 12/14/2025
9.0.0-preview.1.24081.2 37 12/14/2025
8.0.33 7 10/27/2026
8.0.32 12 10/13/2026
8.0.31 23 09/11/2026
8.0.30 22 08/12/2026
8.0.29 24 07/15/2026
8.0.28 22 06/10/2026
8.0.27 34 05/13/2026
8.0.26 48 04/16/2026
8.0.25 33 03/13/2026
8.0.24 97 02/13/2026
8.0.23 41 01/14/2026
8.0.22 45 12/19/2025
8.0.21 41 12/17/2025
8.0.20 6 09/28/2026
8.0.19 42 12/11/2025
8.0.18 39 12/23/2025
8.0.17 55 12/13/2025
8.0.16 45 12/19/2025
8.0.15 31 12/18/2025
8.0.14 40 12/16/2025
8.0.13 27 12/15/2025
8.0.12 47 01/01/2026
8.0.11 62 12/14/2025
8.0.10 38 12/14/2025
8.0.8 22 12/23/2025
8.0.7 51 12/11/2025
8.0.6 53 12/19/2025
8.0.5 26 12/14/2025
8.0.4 75 12/12/2025
8.0.3 34 12/15/2025
8.0.2 3 10/10/2026
8.0.1 46 12/14/2025
8.0.0 25 09/28/2026
8.0.0-rc.2.23480.1 51 12/11/2025
8.0.0-rc.1.23419.6 52 12/14/2025
8.0.0-preview.7.23375.4 36 12/12/2025
8.0.0-preview.6.23329.4 4 09/28/2026
8.0.0-preview.5.23280.1 32 12/13/2025
8.0.0-preview.4.23259.3 42 12/13/2025
8.0.0-preview.3.23174.2 37 12/21/2025
8.0.0-preview.2.23128.3 33 12/20/2025
8.0.0-preview.1.23111.4 44 12/20/2025
7.0.20 30 12/13/2025
7.0.19 30 12/15/2025
7.0.18 6 09/28/2026
7.0.17 6 09/28/2026
7.0.16 4 10/07/2026
7.0.15 45 01/03/2026
7.0.14 40 12/23/2025
7.0.13 1,448 01/02/2026
7.0.12 40 12/11/2025
7.0.11 8 09/29/2026
7.0.10 3 10/12/2026
7.0.9 39 12/14/2025
7.0.8 40 12/14/2025
7.0.7 39 12/16/2025
7.0.5 35 12/14/2025
7.0.4 38 12/11/2025
7.0.3 39 12/14/2025
7.0.2 42 01/03/2026
7.0.1 38 12/27/2025
7.0.0 3 10/17/2026
7.0.0-rc.2.22472.11 49 12/18/2025
7.0.0-rc.1.22426.7 30 12/21/2025
7.0.0-preview.7.22376.2 33 12/15/2025
7.0.0-preview.6.22329.4 37 12/14/2025
7.0.0-preview.5.22302.2 7 09/30/2026
7.0.0-preview.4.22229.2 50 12/14/2025
7.0.0-preview.3.22175.1 47 12/21/2025
7.0.0-preview.2.22153.1 43 12/20/2025
7.0.0-preview.1.22076.6 7 10/03/2026
6.0.36 52 12/15/2025
6.0.35 38 12/11/2025
6.0.33 44 12/15/2025
6.0.32 32 12/11/2025
6.0.31 34 12/17/2025
6.0.30 49 12/13/2025
6.0.29 54 12/14/2025
6.0.28 46 12/15/2025
6.0.27 37 12/17/2025
6.0.26 32 12/15/2025
6.0.25 48 12/13/2025
6.0.24 54 12/15/2025
6.0.23 47 12/23/2025
6.0.22 36 12/12/2025
6.0.21 42 12/14/2025
6.0.20 39 12/15/2025
6.0.19 34 12/14/2025
6.0.18 34 12/20/2025
6.0.16 45 12/20/2025
6.0.15 39 12/16/2025
6.0.14 40 12/15/2025
6.0.13 7 09/29/2026
6.0.12 4 09/29/2026
6.0.11 3 10/04/2026
6.0.10 34 12/23/2025
6.0.9 35 12/15/2025
6.0.8 25 01/01/2026
6.0.7 44 12/11/2025
6.0.6 34 12/12/2025
6.0.5 47 12/17/2025
6.0.4 56 12/10/2025
6.0.3 49 12/22/2025
6.0.2 46 12/24/2025
6.0.1 29 12/14/2025
6.0.0 61 12/21/2025
6.0.0-rc.2.21480.5 48 12/15/2025
6.0.0-rc.1.21452.10 33 12/21/2025
6.0.0-preview.7.21378.4 46 12/15/2025
6.0.0-preview.6.21352.1 24 12/14/2025
6.0.0-preview.5.21301.9 28 12/15/2025
6.0.0-preview.4.21253.1 32 12/14/2025
6.0.0-preview.3.21201.2 42 12/15/2025
6.0.0-preview.2.21154.2 43 12/13/2025
6.0.0-preview.1.21102.2 49 12/14/2025
5.0.17 39 12/22/2025
5.0.16 52 12/12/2025
5.0.15 18 10/02/2026
5.0.14 50 12/14/2025
5.0.13 37 12/14/2025
5.0.12 43 12/13/2025
5.0.11 39 12/27/2025
5.0.10 43 12/12/2025
5.0.9 54 12/15/2025
5.0.8 54 12/15/2025
5.0.7 53 12/16/2025
5.0.6 56 12/16/2025
5.0.5 33 12/25/2025
5.0.4 60 12/23/2025
5.0.3 44 12/15/2025
5.0.2 34 12/23/2025
5.0.1 47 12/15/2025
5.0.0 28 12/24/2025
5.0.0-rc.2.20475.6 38 12/14/2025
5.0.0-rc.1.20451.13 38 12/14/2025
5.0.0-preview.8.20407.4 37 12/14/2025
5.0.0-preview.7.20365.15 55 12/14/2025
5.0.0-preview.6.20312.4 34 12/14/2025
5.0.0-preview.5.20278.2 50 12/14/2025
5.0.0-preview.4.20220.10 41 12/14/2025
5.0.0-preview.3.20181.2 30 12/11/2025
5.0.0-preview.2.20159.4 38 12/17/2025
5.0.0-preview.2.20120.8 33 12/15/2025
3.1.32 59 12/14/2025
3.1.31 45 12/16/2025
3.1.30 56 12/11/2025
3.1.29 49 12/27/2025
3.1.28 28 12/14/2025
3.1.27 51 12/15/2025
3.1.26 48 12/11/2025
3.1.25 37 12/11/2025
3.1.24 33 12/17/2025
3.1.23 38 12/27/2025
3.1.22 44 12/27/2025
3.1.21 43 12/15/2025
3.1.20 42 12/18/2025
3.1.19 37 12/23/2025
3.1.18 40 12/14/2025
3.1.17 44 12/14/2025
3.1.16 48 12/15/2025
3.1.15 29 12/14/2025
3.1.14 47 12/14/2025
3.1.13 52 12/15/2025
3.1.12 57 12/11/2025
3.1.11 51 12/15/2025
3.1.10 8 10/07/2026
3.1.9 59 12/14/2025
3.1.8 44 12/13/2025
3.1.7 41 12/15/2025
3.1.6 37 12/25/2025
3.1.5 48 12/14/2025
3.1.4 34 12/22/2025
3.1.3 47 12/14/2025
3.1.2 35 12/23/2025
3.1.1 10 10/12/2026
3.1.0 36 12/27/2025
3.1.0-preview3.19554.8 53 12/21/2025
3.1.0-preview2.19525.5 47 12/15/2025
3.1.0-preview1.19506.2 26 12/21/2025
3.0.3 47 12/14/2025
3.0.2 59 12/14/2025
3.0.1 52 12/15/2025
3.0.0 6 10/06/2026
3.0.0-rc1.19456.14 51 12/15/2025
3.0.0-preview9.19423.6 45 12/15/2025
3.0.0-preview8.19405.11 37 12/21/2025
3.0.0-preview7.19362.6 40 12/19/2025
3.0.0-preview6.19304.10 2 10/18/2026
3.0.0-preview5.19227.1 5 10/01/2026
3.0.0-preview4.19216.3 37 12/14/2025
3.0.0-preview3.19153.1 45 12/21/2025
3.0.0-preview.19074.3 37 12/16/2025
3.0.0-preview.18572.1 39 12/15/2025
2.3.0 44 12/15/2025
2.2.6 49 12/15/2025
2.2.4 45 12/27/2025
2.2.3 50 12/25/2025
2.2.2 35 12/15/2025
2.2.1 43 12/13/2025
2.2.0 33 12/19/2025
2.2.0-preview3-35497 5 09/29/2026
2.2.0-preview2-35157 41 12/21/2025
2.2.0-preview1-35029 44 12/27/2025
2.1.14 52 12/27/2025
2.1.11 42 12/14/2025
2.1.8 50 12/15/2025
2.1.4 44 12/14/2025
2.1.3 46 12/14/2025
2.1.2 42 12/14/2025
2.1.1 39 12/19/2025
2.1.0 35 12/27/2025
2.1.0-rc1-final 38 12/14/2025
2.1.0-preview2-final 42 12/15/2025
2.1.0-preview1-final 38 12/20/2025
2.0.3 48 12/23/2025
2.0.2 49 12/21/2025
2.0.1 11 09/29/2026
2.0.0 38 12/27/2025
2.0.0-preview2-final 33 12/20/2025
2.0.0-preview1-final 25 12/20/2025
1.1.6 42 12/15/2025
1.1.5 32 12/15/2025
1.1.4 48 12/27/2025
1.1.3 53 12/24/2025
1.1.2 32 12/27/2025
1.1.1 44 12/15/2025
1.1.0 40 12/18/2025
1.1.0-preview1-final 48 12/14/2025
1.0.6 33 12/27/2025
1.0.5 40 12/27/2025
1.0.4 8 10/11/2026
1.0.3 37 12/27/2025
1.0.2 45 12/14/2025
1.0.1 27 12/14/2025
1.0.0 43 12/15/2025
1.0.0-rc2-final 37 12/21/2025