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.2K)

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 (642)

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 5, 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
elsa-workflows/elsa-core
A .NET workflows library
btcpayserver/btcpayserver
Accept Bitcoin payments. Free, open-source & self-hosted, Bitcoin payment processor.
louthy/language-ext
C# pure functional programming framework - come and get declarative!
EduardoPires/EquinoxProject
Web Application ASP.NET 9 using Clean Architecture, DDD, CQRS, Event Sourcing and a lot of good practices
graphql-dotnet/graphql-dotnet
GraphQL for .NET
ldqk/Masuit.Tools
全龄段友好的C#万能工具库,码数吐司库,包含一些常用的操作类,大都是静态类,加密解密,反射操作,权重随机筛选算法,分布式短id,表达式树,linq扩展,文件压缩,多线程下载,硬件信息,字符串扩展方法,日期时间扩展操作,中国农历,大文件拷贝,图像裁剪,验证码,断点续传,集合扩展、Excel导出等常用封装。诸多功能集一身,代码量不到2MB!
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.
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组件,配套代码生成模板,权限等组成。
cobbr/Covenant
Covenant is a collaborative .NET C2 framework for red teamers.
Version Downloads Last Updated
10.0.0-preview.6.25358.103 3,803 7/15/2025
10.0.0-preview.5.25277.114 18,949 6/6/2025
10.0.0-preview.4.25258.110 25,763 5/12/2025
10.0.0-preview.3.25171.6 20,148 4/10/2025
10.0.0-preview.2.25163.8 38,003 3/18/2025
10.0.0-preview.1.25081.1 12,324 2/25/2025
9.0.7 735,334 7/8/2025
9.0.6 2,666,935 6/10/2025
9.0.5 4,206,956 5/13/2025
9.0.4 6,134,779 4/8/2025
9.0.3 6,616,284 3/11/2025
9.0.2 6,854,110 2/11/2025
9.0.1 12,627,842 1/14/2025
9.0.0 17,511,015 11/12/2024
9.0.0-rc.2.24474.1 218,334 10/8/2024
9.0.0-rc.1.24451.1 137,645 9/10/2024
9.0.0-preview.7.24405.3 94,334 8/13/2024
9.0.0-preview.6.24327.4 176,936 7/9/2024
9.0.0-preview.5.24306.3 56,839 6/11/2024
9.0.0-preview.4.24267.1 65,497 5/21/2024
9.0.0-preview.3.24172.4 180,984 4/11/2024
9.0.0-preview.2.24128.4 77,281 3/12/2024
9.0.0-preview.1.24081.2 122,611 2/13/2024
8.0.18 197,151 7/8/2025
8.0.17 1,156,200 6/10/2025
8.0.16 1,475,440 5/13/2025
8.0.15 2,572,647 4/8/2025
8.0.14 3,390,511 3/11/2025
8.0.13 4,819,317 2/11/2025
8.0.12 4,570,856 1/14/2025
8.0.11 19,646,536 11/12/2024
8.0.10 22,880,187 10/8/2024
8.0.8 27,427,787 8/13/2024
8.0.7 16,980,795 7/9/2024
8.0.6 19,155,182 5/28/2024
8.0.5 8,159,460 5/14/2024
8.0.4 30,786,746 4/9/2024
8.0.3 12,578,125 3/12/2024
8.0.2 25,285,612 2/13/2024
8.0.1 16,006,560 1/9/2024
8.0.0 49,944,842 11/14/2023
8.0.0-rc.2.23480.1 549,773 10/10/2023
8.0.0-rc.1.23419.6 157,441 9/12/2023
8.0.0-preview.7.23375.4 122,540 8/8/2023
8.0.0-preview.6.23329.4 217,294 7/11/2023
8.0.0-preview.5.23280.1 192,543 6/13/2023
8.0.0-preview.4.23259.3 141,811 5/16/2023
8.0.0-preview.3.23174.2 253,809 4/11/2023
8.0.0-preview.2.23128.3 199,232 3/14/2023
8.0.0-preview.1.23111.4 141,096 2/21/2023
7.0.20 4,134,108 5/28/2024
7.0.19 553,412 5/14/2024
7.0.18 2,524,808 4/9/2024
7.0.17 1,688,586 3/12/2024
7.0.16 2,171,070 2/13/2024
7.0.15 3,391,090 1/9/2024
7.0.14 6,357,146 11/14/2023
7.0.13 7,152,417 10/24/2023
7.0.12 4,549,925 10/10/2023
7.0.11 14,363,500 9/12/2023
7.0.10 10,012,724 8/8/2023
7.0.9 9,416,884 7/11/2023
7.0.8 5,722,461 6/22/2023
7.0.7 3,857,296 6/13/2023
7.0.5 26,564,252 4/11/2023
7.0.4 9,621,099 3/14/2023
7.0.3 14,179,856 2/14/2023
7.0.2 19,457,482 1/10/2023
7.0.1 10,350,392 12/13/2022
7.0.0 32,683,700 11/7/2022
7.0.0-rc.2.22472.11 226,605 10/11/2022
7.0.0-rc.1.22426.7 215,924 9/14/2022
7.0.0-preview.7.22376.2 99,815 8/9/2022
7.0.0-preview.6.22329.4 77,936 7/12/2022
7.0.0-preview.5.22302.2 65,880 6/14/2022
7.0.0-preview.4.22229.2 89,037 5/10/2022
7.0.0-preview.3.22175.1 79,324 4/13/2022
7.0.0-preview.2.22153.1 86,620 3/14/2022
7.0.0-preview.1.22076.6 59,158 2/17/2022
6.0.36 1,813,529 11/12/2024
6.0.35 744,401 10/8/2024
6.0.33 1,976,581 8/13/2024
6.0.32 851,579 7/9/2024
6.0.31 1,155,610 5/28/2024
6.0.30 644,679 5/14/2024
6.0.29 2,940,078 4/9/2024
6.0.28 1,692,944 3/12/2024
6.0.27 1,960,835 2/13/2024
6.0.26 2,748,673 1/9/2024
6.0.25 3,792,748 11/14/2023
6.0.24 1,945,416 10/24/2023
6.0.23 1,274,991 10/10/2023
6.0.22 3,478,271 9/12/2023
6.0.21 3,707,792 8/8/2023
6.0.20 2,971,548 7/11/2023
6.0.19 2,490,983 6/22/2023
6.0.18 1,313,676 6/13/2023
6.0.16 7,805,551 4/11/2023
6.0.15 4,302,726 3/14/2023
6.0.14 5,416,333 2/14/2023
6.0.13 7,101,365 1/10/2023
6.0.12 11,136,044 12/13/2022
6.0.11 10,151,759 11/7/2022
6.0.10 17,903,206 10/11/2022
6.0.9 15,611,881 9/13/2022
6.0.8 18,824,550 8/9/2022
6.0.7 50,899,068 7/12/2022
6.0.6 15,150,455 6/14/2022
6.0.5 23,042,038 5/10/2022
6.0.4 18,235,277 4/11/2022
6.0.3 25,607,576 3/8/2022
6.0.2 20,138,375 2/8/2022
6.0.1 33,693,744 12/14/2021
6.0.0 72,637,415 11/8/2021
6.0.0-rc.2.21480.5 332,482 10/12/2021
6.0.0-rc.1.21452.10 272,542 9/14/2021
6.0.0-preview.7.21378.4 101,184 8/10/2021
6.0.0-preview.6.21352.1 44,720 7/14/2021
6.0.0-preview.5.21301.9 190,671 6/15/2021
6.0.0-preview.4.21253.1 79,047 5/24/2021
6.0.0-preview.3.21201.2 102,174 4/8/2021
6.0.0-preview.2.21154.2 75,133 3/11/2021
6.0.0-preview.1.21102.2 97,919 2/12/2021
5.0.17 8,048,538 5/10/2022 5.0.17 is deprecated because it is no longer maintained.
5.0.16 1,526,298 4/11/2022 5.0.16 is deprecated because it is no longer maintained.
5.0.15 2,377,278 3/8/2022 5.0.15 is deprecated because it is no longer maintained.
5.0.14 2,396,175 2/8/2022 5.0.14 is deprecated because it is no longer maintained.
5.0.13 4,551,315 12/14/2021 5.0.13 is deprecated because it is no longer maintained.
5.0.12 4,910,736 11/7/2021 5.0.12 is deprecated because it is no longer maintained.
5.0.11 8,563,174 10/12/2021 5.0.11 is deprecated because it is no longer maintained.
5.0.10 13,756,714 9/14/2021 5.0.10 is deprecated because it is no longer maintained.
5.0.9 10,528,828 8/10/2021 5.0.9 is deprecated because it is no longer maintained.
5.0.8 9,857,034 7/13/2021 5.0.8 is deprecated because it is no longer maintained.
5.0.7 14,775,053 6/8/2021 5.0.7 is deprecated because it is no longer maintained.
5.0.6 8,355,065 5/11/2021 5.0.6 is deprecated because it is no longer maintained.
5.0.5 11,680,003 4/6/2021 5.0.5 is deprecated because it is no longer maintained.
5.0.4 8,447,109 3/9/2021 5.0.4 is deprecated because it is no longer maintained.
5.0.3 8,192,537 2/9/2021 5.0.3 is deprecated because it is no longer maintained.
5.0.2 10,668,537 1/12/2021 5.0.2 is deprecated because it is no longer maintained.
5.0.1 16,320,469 12/8/2020 5.0.1 is deprecated because it is no longer maintained.
5.0.0 27,625,020 11/9/2020 5.0.0 is deprecated because it is no longer maintained.
5.0.0-rc.2.20475.6 387,980 10/13/2020
5.0.0-rc.1.20451.13 322,631 9/14/2020
5.0.0-preview.8.20407.4 208,561 8/25/2020
5.0.0-preview.7.20365.15 118,353 7/21/2020
5.0.0-preview.6.20312.4 64,262 6/25/2020
5.0.0-preview.5.20278.2 50,757 6/10/2020
5.0.0-preview.4.20220.10 74,418 5/18/2020
5.0.0-preview.3.20181.2 95,193 4/23/2020
5.0.0-preview.2.20159.4 62,300 4/2/2020
5.0.0-preview.2.20120.8 46,346 3/16/2020
3.1.32 6,675,768 12/13/2022
3.1.31 1,354,749 11/8/2022
3.1.30 792,761 10/11/2022
3.1.29 1,397,054 9/13/2022
3.1.28 899,244 8/9/2022
3.1.27 778,527 7/12/2022
3.1.26 689,140 6/14/2022
3.1.25 1,130,001 5/10/2022
3.1.24 673,328 4/11/2022
3.1.23 1,099,504 3/8/2022
3.1.22 3,634,059 12/14/2021
3.1.21 2,694,094 11/7/2021
3.1.20 1,671,012 10/11/2021
3.1.19 2,531,982 9/14/2021
3.1.18 5,544,466 8/10/2021
3.1.17 1,941,642 7/13/2021
3.1.16 2,435,702 6/8/2021
3.1.15 2,945,179 5/11/2021
3.1.14 3,179,972 4/6/2021
3.1.13 4,753,033 3/9/2021
3.1.12 3,062,480 2/9/2021
3.1.11 5,558,849 1/12/2021
3.1.10 8,465,298 11/9/2020
3.1.9 12,237,739 10/13/2020
3.1.8 17,907,742 9/8/2020
3.1.7 10,307,643 8/11/2020
3.1.6 10,972,084 7/14/2020
3.1.5 13,054,895 6/9/2020
3.1.4 18,274,849 5/12/2020
3.1.3 28,530,651 3/24/2020
3.1.2 12,097,919 2/19/2020
3.1.1 20,427,281 1/14/2020
3.1.0 35,120,440 12/3/2019
3.1.0-preview3.19554.8 165,587 11/13/2019
3.1.0-preview2.19525.5 33,066 11/1/2019
3.1.0-preview1.19506.2 774,885 10/15/2019
3.0.3 194,291 2/19/2020
3.0.2 81,037 1/14/2020
3.0.1 1,420,983 11/18/2019
3.0.0 19,414,868 9/23/2019
3.0.0-rc1.19456.14 46,945 9/16/2019
3.0.0-preview9.19423.6 1,391,960 9/4/2019
3.0.0-preview8.19405.11 413,119 8/13/2019
3.0.0-preview7.19362.6 92,782 7/23/2019
3.0.0-preview6.19304.10 168,548 6/12/2019
3.0.0-preview5.19227.1 672,595 5/6/2019
3.0.0-preview4.19216.3 23,204 4/18/2019
3.0.0-preview3.19153.1 202,858 3/6/2019
3.0.0-preview.19074.3 32,268 1/29/2019
3.0.0-preview.18572.1 48,902 12/3/2018
2.3.0 25,323 1/14/2025
2.2.6 32,244,222 7/9/2019 2.2.6 is deprecated because it is no longer maintained.
2.2.4 19,726,775 4/9/2019 2.2.4 is deprecated because it is no longer maintained.
2.2.3 5,388,873 3/11/2019 2.2.3 is deprecated because it is no longer maintained.
2.2.2 6,491,770 2/12/2019 2.2.2 is deprecated because it is no longer maintained.
2.2.1 6,944,015 1/8/2019 2.2.1 is deprecated because it is no longer maintained.
2.2.0 22,240,934 12/3/2018 2.2.0 is deprecated because it is no longer maintained.
2.2.0-preview3-35497 185,339 10/17/2018
2.2.0-preview2-35157 152,065 9/12/2018
2.2.0-preview1-35029 84,544 8/22/2018
2.1.14 4,063,105 11/18/2019
2.1.11 3,722,145 5/14/2019
2.1.8 3,836,352 2/12/2019
2.1.4 15,673,279 10/1/2018
2.1.3 4,923,015 9/11/2018
2.1.2 8,163,108 8/21/2018
2.1.1 17,010,042 6/18/2018
2.1.0 13,427,820 5/29/2018
2.1.0-rc1-final 224,993 5/6/2018
2.1.0-preview2-final 206,306 4/10/2018
2.1.0-preview1-final 318,653 2/26/2018
2.0.3 5,420,366 5/7/2018 2.0.3 is deprecated because it is no longer maintained.
2.0.2 6,764,045 3/13/2018 2.0.2 is deprecated because it is no longer maintained.
2.0.1 12,692,484 11/14/2017 2.0.1 is deprecated because it is no longer maintained.
2.0.0 27,828,829 8/11/2017 2.0.0 is deprecated because it is no longer maintained.
2.0.0-preview2-final 96,737 6/28/2017 2.0.0-preview2-final is deprecated because it is no longer maintained.
2.0.0-preview1-final 1,134,092 5/10/2017 2.0.0-preview1-final is deprecated because it is no longer maintained.
1.1.6 6,103,349 7/10/2018 1.1.6 is deprecated because it is no longer maintained.
1.1.5 1,255,175 12/12/2017 1.1.5 is deprecated because it is no longer maintained.
1.1.4 228,116 11/14/2017 1.1.4 is deprecated because it is no longer maintained.
1.1.3 309,848 9/20/2017 1.1.3 is deprecated because it is no longer maintained.
1.1.2 5,139,884 5/9/2017 1.1.2 is deprecated because it is no longer maintained.
1.1.1 3,302,272 3/6/2017 1.1.1 is deprecated because it is no longer maintained.
1.1.0 7,767,079 11/16/2016 1.1.0 is deprecated because it is no longer maintained.
1.1.0-preview1-final 46,801 10/24/2016 1.1.0-preview1-final is deprecated because it is no longer maintained.
1.0.6 55,449 11/14/2017 1.0.6 is deprecated because it is no longer maintained.
1.0.5 43,779 9/20/2017 1.0.5 is deprecated because it is no longer maintained.
1.0.4 58,597 5/9/2017 1.0.4 is deprecated because it is no longer maintained.
1.0.3 684,175 3/6/2017 1.0.3 is deprecated because it is no longer maintained.
1.0.2 78,740 12/12/2016 1.0.2 is deprecated because it is no longer maintained.
1.0.1 836,398 9/13/2016 1.0.1 is deprecated because it is no longer maintained.
1.0.0 1,953,444 6/27/2016 1.0.0 is deprecated because it is no longer maintained.
1.0.0-rc2-final 144,587 5/16/2016 1.0.0-rc2-final is deprecated because it is no longer maintained.