Microsoft.EntityFrameworkCore 8.0.17

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.

Requires NuGet 3.6 or higher.

dotnet add package Microsoft.EntityFrameworkCore --version 8.0.17
                    
NuGet\Install-Package Microsoft.EntityFrameworkCore -Version 8.0.17
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.17" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="8.0.17" />
                    
Directory.Packages.props
<PackageReference Include="Microsoft.EntityFrameworkCore" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Microsoft.EntityFrameworkCore --version 8.0.17
                    
#r "nuget: Microsoft.EntityFrameworkCore, 8.0.17"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Microsoft.EntityFrameworkCore@8.0.17
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Microsoft.EntityFrameworkCore&version=8.0.17
                    
Install as a Cake Addin
#tool nuget:?package=Microsoft.EntityFrameworkCore&version=8.0.17
                    
Install as a Cake Tool

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.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (9.4K)

Showing the top 5 NuGet packages that depend on Microsoft.EntityFrameworkCore:

Package Downloads
Microsoft.EntityFrameworkCore.Relational

Shared Entity Framework Core components for relational database providers.

Microsoft.EntityFrameworkCore.InMemory

In-memory database provider for Entity Framework Core (to be used for testing purposes).

Npgsql.EntityFrameworkCore.PostgreSQL

PostgreSQL/Npgsql provider for Entity Framework Core.

Microsoft.EntityFrameworkCore.Proxies

Lazy loading proxies for Entity Framework Core.

EFCore.NamingConventions

Naming Conventions for Entity Framework Core Tables and Columns.

GitHub repositories (648)

Showing the top 20 popular GitHub repositories that depend on Microsoft.EntityFrameworkCore:

Repository Stars
abpframework/abp
Open-source web application framework for ASP.NET Core! Offers an opinionated architecture to build enterprise software solutions with best practices on top of the .NET. Provides the fundamental infrastructure, cross-cutting-concern implementations, startup templates, application modules, UI themes, tooling and documentation.
dotnet/AspNetCore.Docs
Documentation for ASP.NET Core
kgrzybek/modular-monolith-with-ddd
Full Modular Monolith application with Domain-Driven Design approach.
aspnetboilerplate/aspnetboilerplate
ASP.NET Boilerplate - Web Application Framework
dodyg/practical-aspnetcore
Practical samples of ASP.NET Core 10 Preview 7, 9, 8.0, 7.0, 6.0, 5.0, 3.1, 2.2, and 2.1,projects you can use. Readme contains explanations on all projects.
davidfowl/AspNetCoreDiagnosticScenarios
This repository has examples of broken patterns in ASP.NET Core applications
RayWangQvQ/BiliBiliToolPro
B 站(bilibili)自动任务工具,支持docker、青龙、k8s等多种部署方式。敏感肌也能用。
btcpayserver/btcpayserver
Accept Bitcoin payments. Free, open-source & self-hosted, Bitcoin payment processor.
EduardoPires/EquinoxProject
Web Application ASP.NET 9 using Clean Architecture, DDD, CQRS, Event Sourcing and a lot of good practices
fullstackhero/dotnet-starter-kit
Production Grade Cloud-Ready .NET 9 Starter Kit (Web API + Blazor Client) with Multitenancy Support, and Clean/Modular Architecture that saves roughly 200+ Development Hours! All Batteries Included.
ldqk/Masuit.Tools
全龄段友好的C#万能工具库,码数吐司库,包含一些常用的操作类,大都是静态类,加密解密,反射操作,权重随机筛选算法,分布式短id,表达式树,linq扩展,文件压缩,多线程下载,硬件信息,字符串扩展方法,日期时间扩展操作,中国农历,大文件拷贝,图像裁剪,验证码,断点续传,集合扩展、Excel导出等常用封装。诸多功能集一身,代码量不到2MB!
graphql-dotnet/graphql-dotnet
GraphQL for .NET
danielgerlag/workflow-core
Lightweight workflow engine for .NET Standard
ChilliCream/graphql-platform
Welcome to the home of the Hot Chocolate GraphQL server for .NET, the Strawberry Shake GraphQL client for .NET and Nitro the awesome Monaco based GraphQL IDE.
jasontaylordev/NorthwindTraders
Northwind Traders is a sample application built using ASP.NET Core and Entity Framework Core.
immense/Remotely
A remote control and remote scripting solution, built with .NET 8, Blazor, and SignalR.
MapsterMapper/Mapster
A fast, fun and stimulating object to object Mapper
dotnetcore/Util
Util是一个.Net平台下的应用框架,旨在提升中小团队的开发能力,由工具类、分层架构基类、Ui组件,配套代码生成模板,权限等组成。
microsoft/fluentui-blazor
Microsoft Fluent UI Blazor components library. For use with ASP.NET Core Blazor applications
cobbr/Covenant
Covenant is a collaborative .NET C2 framework for red teamers.
Version Downloads Last Updated
10.0.0-preview.7.25380.108 23,438 8/12/2025
10.0.0-preview.6.25358.103 12,749 7/15/2025
10.0.0-preview.5.25277.114 41,309 6/6/2025
10.0.0-preview.4.25258.110 26,228 5/12/2025
10.0.0-preview.3.25171.6 20,571 4/10/2025
10.0.0-preview.2.25163.8 51,737 3/18/2025
10.0.0-preview.1.25081.1 12,512 2/25/2025
9.0.8 2,671,048 8/5/2025
9.0.7 2,602,664 7/8/2025
9.0.6 3,911,927 6/10/2025
9.0.5 5,547,794 5/13/2025
9.0.4 7,344,774 4/8/2025
9.0.3 7,389,131 3/11/2025
9.0.2 7,812,778 2/11/2025
9.0.1 15,876,654 1/14/2025
9.0.0 20,268,728 11/12/2024
9.0.0-rc.2.24474.1 227,177 10/8/2024
9.0.0-rc.1.24451.1 143,080 9/10/2024
9.0.0-preview.7.24405.3 99,526 8/13/2024
9.0.0-preview.6.24327.4 196,510 7/9/2024
9.0.0-preview.5.24306.3 63,914 6/11/2024
9.0.0-preview.4.24267.1 68,323 5/21/2024
9.0.0-preview.3.24172.4 183,633 4/11/2024
9.0.0-preview.2.24128.4 81,098 3/12/2024
9.0.0-preview.1.24081.2 131,942 2/13/2024
8.0.19 821,525 8/5/2025
8.0.18 765,332 7/8/2025
8.0.17 2,128,945 6/10/2025
8.0.16 2,010,354 5/13/2025
8.0.15 3,184,727 4/8/2025
8.0.14 4,075,644 3/11/2025
8.0.13 5,788,701 2/11/2025
8.0.12 5,236,388 1/14/2025
8.0.11 22,527,154 11/12/2024
8.0.10 24,870,464 10/8/2024
8.0.8 29,497,545 8/13/2024
8.0.7 17,994,983 7/9/2024
8.0.6 20,223,347 5/28/2024
8.0.5 8,550,097 5/14/2024
8.0.4 32,613,171 4/9/2024
8.0.3 13,171,494 3/12/2024
8.0.2 26,966,091 2/13/2024
8.0.1 16,817,220 1/9/2024
8.0.0 53,837,486 11/14/2023
8.0.0-rc.2.23480.1 561,378 10/10/2023
8.0.0-rc.1.23419.6 158,734 9/12/2023
8.0.0-preview.7.23375.4 125,774 8/8/2023
8.0.0-preview.6.23329.4 225,067 7/11/2023
8.0.0-preview.5.23280.1 198,874 6/13/2023
8.0.0-preview.4.23259.3 144,182 5/16/2023
8.0.0-preview.3.23174.2 275,271 4/11/2023
8.0.0-preview.2.23128.3 200,415 3/14/2023
8.0.0-preview.1.23111.4 141,761 2/21/2023
7.0.20 4,493,519 5/28/2024
7.0.19 573,932 5/14/2024
7.0.18 2,646,964 4/9/2024
7.0.17 1,722,532 3/12/2024
7.0.16 2,220,235 2/13/2024
7.0.15 3,463,682 1/9/2024
7.0.14 6,478,645 11/14/2023
7.0.13 7,352,213 10/24/2023
7.0.12 4,611,016 10/10/2023
7.0.11 14,692,320 9/12/2023
7.0.10 10,174,635 8/8/2023
7.0.9 9,596,149 7/11/2023
7.0.8 5,817,082 6/22/2023
7.0.7 3,904,620 6/13/2023
7.0.5 27,020,505 4/11/2023
7.0.4 9,723,258 3/14/2023
7.0.3 14,377,881 2/14/2023
7.0.2 19,788,590 1/10/2023
7.0.1 10,517,629 12/13/2022
7.0.0 33,871,538 11/7/2022
7.0.0-rc.2.22472.11 228,437 10/11/2022
7.0.0-rc.1.22426.7 216,820 9/14/2022
7.0.0-preview.7.22376.2 100,312 8/9/2022
7.0.0-preview.6.22329.4 78,611 7/12/2022
7.0.0-preview.5.22302.2 66,116 6/14/2022
7.0.0-preview.4.22229.2 90,743 5/10/2022
7.0.0-preview.3.22175.1 79,520 4/13/2022
7.0.0-preview.2.22153.1 86,801 3/14/2022
7.0.0-preview.1.22076.6 59,385 2/17/2022
6.0.36 2,164,690 11/12/2024
6.0.35 799,167 10/8/2024
6.0.33 2,110,652 8/13/2024
6.0.32 888,403 7/9/2024
6.0.31 1,203,211 5/28/2024
6.0.30 686,902 5/14/2024
6.0.29 3,077,127 4/9/2024
6.0.28 1,769,732 3/12/2024
6.0.27 2,020,195 2/13/2024
6.0.26 2,816,791 1/9/2024
6.0.25 3,883,740 11/14/2023
6.0.24 1,980,073 10/24/2023
6.0.23 1,293,550 10/10/2023
6.0.22 3,536,536 9/12/2023
6.0.21 3,770,839 8/8/2023
6.0.20 3,022,992 7/11/2023
6.0.19 2,541,251 6/22/2023
6.0.18 1,332,954 6/13/2023
6.0.16 7,903,022 4/11/2023
6.0.15 4,363,788 3/14/2023
6.0.14 5,475,841 2/14/2023
6.0.13 7,186,467 1/10/2023
6.0.12 11,284,201 12/13/2022
6.0.11 10,259,005 11/7/2022
6.0.10 18,071,675 10/11/2022
6.0.9 15,772,069 9/13/2022
6.0.8 19,032,554 8/9/2022
6.0.7 51,465,945 7/12/2022
6.0.6 15,337,055 6/14/2022
6.0.5 23,297,983 5/10/2022
6.0.4 18,390,710 4/11/2022
6.0.3 26,154,437 3/8/2022
6.0.2 20,312,760 2/8/2022
6.0.1 34,121,065 12/14/2021
6.0.0 74,437,399 11/8/2021
6.0.0-rc.2.21480.5 333,801 10/12/2021
6.0.0-rc.1.21452.10 273,518 9/14/2021
6.0.0-preview.7.21378.4 101,783 8/10/2021
6.0.0-preview.6.21352.1 44,954 7/14/2021
6.0.0-preview.5.21301.9 191,523 6/15/2021
6.0.0-preview.4.21253.1 79,322 5/24/2021
6.0.0-preview.3.21201.2 102,711 4/8/2021
6.0.0-preview.2.21154.2 75,190 3/11/2021
6.0.0-preview.1.21102.2 98,205 2/12/2021
5.0.17 8,194,885 5/10/2022 5.0.17 is deprecated because it is no longer maintained.
5.0.16 1,539,933 4/11/2022 5.0.16 is deprecated because it is no longer maintained.
5.0.15 2,392,096 3/8/2022 5.0.15 is deprecated because it is no longer maintained.
5.0.14 2,410,030 2/8/2022 5.0.14 is deprecated because it is no longer maintained.
5.0.13 4,588,842 12/14/2021 5.0.13 is deprecated because it is no longer maintained.
5.0.12 4,939,360 11/7/2021 5.0.12 is deprecated because it is no longer maintained.
5.0.11 8,614,414 10/12/2021 5.0.11 is deprecated because it is no longer maintained.
5.0.10 13,884,482 9/14/2021 5.0.10 is deprecated because it is no longer maintained.
5.0.9 10,593,884 8/10/2021 5.0.9 is deprecated because it is no longer maintained.
5.0.8 9,929,472 7/13/2021 5.0.8 is deprecated because it is no longer maintained.
5.0.7 14,872,765 6/8/2021 5.0.7 is deprecated because it is no longer maintained.
5.0.6 8,396,562 5/11/2021 5.0.6 is deprecated because it is no longer maintained.
5.0.5 11,751,722 4/6/2021 5.0.5 is deprecated because it is no longer maintained.
5.0.4 8,483,065 3/9/2021 5.0.4 is deprecated because it is no longer maintained.
5.0.3 8,219,716 2/9/2021 5.0.3 is deprecated because it is no longer maintained.
5.0.2 10,699,063 1/12/2021 5.0.2 is deprecated because it is no longer maintained.
5.0.1 16,427,504 12/8/2020 5.0.1 is deprecated because it is no longer maintained.
5.0.0 27,918,194 11/9/2020 5.0.0 is deprecated because it is no longer maintained.
5.0.0-rc.2.20475.6 389,144 10/13/2020
5.0.0-rc.1.20451.13 323,008 9/14/2020
5.0.0-preview.8.20407.4 209,255 8/25/2020
5.0.0-preview.7.20365.15 118,625 7/21/2020
5.0.0-preview.6.20312.4 64,405 6/25/2020
5.0.0-preview.5.20278.2 51,184 6/10/2020
5.0.0-preview.4.20220.10 74,536 5/18/2020
5.0.0-preview.3.20181.2 95,321 4/23/2020
5.0.0-preview.2.20159.4 62,580 4/2/2020
5.0.0-preview.2.20120.8 46,401 3/16/2020
3.1.32 7,080,965 12/13/2022
3.1.31 1,480,275 11/8/2022
3.1.30 815,236 10/11/2022
3.1.29 1,440,616 9/13/2022
3.1.28 918,166 8/9/2022
3.1.27 797,964 7/12/2022
3.1.26 702,842 6/14/2022
3.1.25 1,143,741 5/10/2022
3.1.24 679,391 4/11/2022
3.1.23 1,110,270 3/8/2022
3.1.22 3,714,267 12/14/2021
3.1.21 2,713,514 11/7/2021
3.1.20 1,699,510 10/11/2021
3.1.19 2,549,748 9/14/2021
3.1.18 5,649,211 8/10/2021
3.1.17 1,959,499 7/13/2021
3.1.16 2,452,316 6/8/2021
3.1.15 2,980,729 5/11/2021
3.1.14 3,200,170 4/6/2021
3.1.13 4,800,344 3/9/2021
3.1.12 3,080,715 2/9/2021
3.1.11 5,587,145 1/12/2021
3.1.10 8,498,064 11/9/2020
3.1.9 12,302,228 10/13/2020
3.1.8 17,959,953 9/8/2020
3.1.7 10,380,405 8/11/2020
3.1.6 11,028,331 7/14/2020
3.1.5 13,107,396 6/9/2020
3.1.4 18,371,084 5/12/2020
3.1.3 28,708,337 3/24/2020
3.1.2 12,149,188 2/19/2020
3.1.1 20,578,928 1/14/2020
3.1.0 35,383,055 12/3/2019
3.1.0-preview3.19554.8 165,915 11/13/2019
3.1.0-preview2.19525.5 33,326 11/1/2019
3.1.0-preview1.19506.2 780,643 10/15/2019
3.0.3 196,390 2/19/2020
3.0.2 82,160 1/14/2020
3.0.1 1,428,048 11/18/2019
3.0.0 19,530,500 9/23/2019
3.0.0-rc1.19456.14 47,009 9/16/2019
3.0.0-preview9.19423.6 1,395,224 9/4/2019
3.0.0-preview8.19405.11 413,337 8/13/2019
3.0.0-preview7.19362.6 94,066 7/23/2019
3.0.0-preview6.19304.10 168,716 6/12/2019
3.0.0-preview5.19227.1 672,874 5/6/2019
3.0.0-preview4.19216.3 23,251 4/18/2019
3.0.0-preview3.19153.1 203,022 3/6/2019
3.0.0-preview.19074.3 32,542 1/29/2019
3.0.0-preview.18572.1 49,020 12/3/2018
2.3.0 31,985 1/14/2025
2.2.6 32,418,058 7/9/2019 2.2.6 is deprecated because it is no longer maintained.
2.2.4 19,793,080 4/9/2019 2.2.4 is deprecated because it is no longer maintained.
2.2.3 5,402,222 3/11/2019 2.2.3 is deprecated because it is no longer maintained.
2.2.2 6,519,766 2/12/2019 2.2.2 is deprecated because it is no longer maintained.
2.2.1 6,960,339 1/8/2019 2.2.1 is deprecated because it is no longer maintained.
2.2.0 22,449,852 12/3/2018 2.2.0 is deprecated because it is no longer maintained.
2.2.0-preview3-35497 185,629 10/17/2018
2.2.0-preview2-35157 153,513 9/12/2018
2.2.0-preview1-35029 85,722 8/22/2018
2.1.14 4,091,531 11/18/2019
2.1.11 3,730,703 5/14/2019
2.1.8 3,864,758 2/12/2019
2.1.4 15,714,850 10/1/2018
2.1.3 4,939,234 9/11/2018
2.1.2 8,180,981 8/21/2018
2.1.1 17,256,701 6/18/2018
2.1.0 13,486,865 5/29/2018
2.1.0-rc1-final 225,122 5/6/2018
2.1.0-preview2-final 206,699 4/10/2018
2.1.0-preview1-final 319,124 2/26/2018
2.0.3 5,469,046 5/7/2018 2.0.3 is deprecated because it is no longer maintained.
2.0.2 6,794,840 3/13/2018 2.0.2 is deprecated because it is no longer maintained.
2.0.1 12,750,620 11/14/2017 2.0.1 is deprecated because it is no longer maintained.
2.0.0 28,038,297 8/11/2017 2.0.0 is deprecated because it is no longer maintained.
2.0.0-preview2-final 96,916 6/28/2017 2.0.0-preview2-final is deprecated because it is no longer maintained.
2.0.0-preview1-final 1,141,623 5/10/2017 2.0.0-preview1-final is deprecated because it is no longer maintained.
1.1.6 6,194,026 7/10/2018 1.1.6 is deprecated because it is no longer maintained.
1.1.5 1,258,671 12/12/2017 1.1.5 is deprecated because it is no longer maintained.
1.1.4 230,415 11/14/2017 1.1.4 is deprecated because it is no longer maintained.
1.1.3 311,248 9/20/2017 1.1.3 is deprecated because it is no longer maintained.
1.1.2 5,198,843 5/9/2017 1.1.2 is deprecated because it is no longer maintained.
1.1.1 3,343,107 3/6/2017 1.1.1 is deprecated because it is no longer maintained.
1.1.0 7,938,685 11/16/2016 1.1.0 is deprecated because it is no longer maintained.
1.1.0-preview1-final 46,876 10/24/2016 1.1.0-preview1-final is deprecated because it is no longer maintained.
1.0.6 56,525 11/14/2017 1.0.6 is deprecated because it is no longer maintained.
1.0.5 44,794 9/20/2017 1.0.5 is deprecated because it is no longer maintained.
1.0.4 59,674 5/9/2017 1.0.4 is deprecated because it is no longer maintained.
1.0.3 699,340 3/6/2017 1.0.3 is deprecated because it is no longer maintained.
1.0.2 79,683 12/12/2016 1.0.2 is deprecated because it is no longer maintained.
1.0.1 852,971 9/13/2016 1.0.1 is deprecated because it is no longer maintained.
1.0.0 2,021,137 6/27/2016 1.0.0 is deprecated because it is no longer maintained.
1.0.0-rc2-final 145,391 5/16/2016 1.0.0-rc2-final is deprecated because it is no longer maintained.