Microsoft.EntityFrameworkCore 10.0.0-preview.5.25277.114 (original) (raw)

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 net10.0 is compatible. 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.

NuGet packages (9.1K)

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. 1.5B
Microsoft.EntityFrameworkCore.InMemory In-memory database provider for Entity Framework Core (to be used for testing purposes). 305.6M
Npgsql.EntityFrameworkCore.PostgreSQL PostgreSQL/Npgsql provider for Entity Framework Core. 266.8M
Microsoft.EntityFrameworkCore.Proxies Lazy loading proxies for Entity Framework Core. 77.3M
EFCore.NamingConventions Naming Conventions for Entity Framework Core Tables and Columns. 38.9M

GitHub repositories (631)

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

Repository Stars
jasontaylordev/CleanArchitecture Clean Architecture Solution Template for ASP.NET Core 18.5K
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. 13.6K
dotnet/AspNetCore.Docs Documentation for ASP.NET Core 12.9K
kgrzybek/modular-monolith-with-ddd Full Modular Monolith application with Domain-Driven Design approach. 12.3K
aspnetboilerplate/aspnetboilerplate ASP.NET Boilerplate - Web Application Framework 11.9K
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. 10.0K
davidfowl/AspNetCoreDiagnosticScenarios This repository has examples of broken patterns in ASP.NET Core applications 8.4K
elsa-workflows/elsa-core A .NET workflows library 7.2K
louthy/language-ext C# pure functional programming framework - come and get declarative! 6.9K
btcpayserver/btcpayserver Accept Bitcoin payments. Free, open-source & self-hosted, Bitcoin payment processor. 6.9K
EduardoPires/EquinoxProject Web Application ASP.NET 9 using Clean Architecture, DDD, CQRS, Event Sourcing and a lot of good practices 6.7K
graphql-dotnet/graphql-dotnet GraphQL for .NET 5.9K
ldqk/Masuit.Tools 全龄段友好的C#万能工具库,码数吐司库,包含一些常用的操作类,大都是静态类,加密解密,反射操作,权重随机筛选算法,分布式短id,表达式树,linq扩展,文件压缩,多线程下载,硬件信息,字符串扩展方法,日期时间扩展操作,中国农历,大文件拷贝,图像裁剪,验证码,断点续传,集合扩展、Excel导出等常用封装。诸多功能集一身,代码量不到2MB! 5.9K
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. 5.7K
danielgerlag/workflow-core Lightweight workflow engine for .NET Standard 5.6K
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. 5.5K
jasontaylordev/NorthwindTraders Northwind Traders is a sample application built using ASP.NET Core and Entity Framework Core. 5.0K
immense/Remotely A remote control and remote scripting solution, built with .NET 8, Blazor, and SignalR. 4.8K
MapsterMapper/Mapster A fast, fun and stimulating object to object Mapper 4.7K
dotnetcore/Util Util是一个.Net平台下的应用框架,旨在提升中小团队的开发能力,由工具类、分层架构基类、Ui组件,配套代码生成模板,权限等组成。 4.6K
Version Downloads Last Updated
10.0.0-preview.5.25277.114 12,514 6/6/2025
10.0.0-preview.4.25258.110 24,955 5/12/2025
10.0.0-preview.3.25171.6 19,522 4/10/2025
10.0.0-preview.2.25163.8 29,907 3/18/2025
10.0.0-preview.1.25081.1 12,221 2/25/2025
9.0.6 1,711,418 6/10/2025
9.0.5 3,550,767 5/13/2025
9.0.4 5,570,371 4/8/2025
9.0.3 6,239,565 3/11/2025
9.0.2 6,437,152 2/11/2025
9.0.1 11,415,216 1/14/2025
9.0.0 16,416,675 11/12/2024
9.0.0-rc.2.24474.1 215,461 10/8/2024
9.0.0-rc.1.24451.1 135,567 9/10/2024
9.0.0-preview.7.24405.3 91,567 8/13/2024
9.0.0-preview.6.24327.4 165,281 7/9/2024
9.0.0-preview.5.24306.3 54,247 6/11/2024
9.0.0-preview.4.24267.1 64,198 5/21/2024
9.0.0-preview.3.24172.4 180,126 4/11/2024
9.0.0-preview.2.24128.4 75,406 3/12/2024
9.0.0-preview.1.24081.2 119,974 2/13/2024
8.0.17 689,191 6/10/2025
8.0.16 1,222,151 5/13/2025
8.0.15 2,301,699 4/8/2025
8.0.14 3,051,891 3/11/2025
8.0.13 4,375,860 2/11/2025
8.0.12 4,290,040 1/14/2025
8.0.11 18,431,890 11/12/2024
8.0.10 22,016,289 10/8/2024
8.0.8 26,601,061 8/13/2024
8.0.7 16,539,950 7/9/2024
8.0.6 18,704,697 5/28/2024
8.0.5 7,979,387 5/14/2024
8.0.4 29,968,342 4/9/2024
8.0.3 12,318,866 3/12/2024
8.0.2 24,605,719 2/13/2024
8.0.1 15,665,067 1/9/2024
8.0.0 48,365,130 11/14/2023
8.0.0-rc.2.23480.1 544,873 10/10/2023
8.0.0-rc.1.23419.6 156,921 9/12/2023
8.0.0-preview.7.23375.4 121,339 8/8/2023
8.0.0-preview.6.23329.4 213,899 7/11/2023
8.0.0-preview.5.23280.1 189,639 6/13/2023
8.0.0-preview.4.23259.3 140,875 5/16/2023
8.0.0-preview.3.23174.2 247,138 4/11/2023
8.0.0-preview.2.23128.3 198,759 3/14/2023
8.0.0-preview.1.23111.4 140,752 2/21/2023
7.0.20 3,969,098 5/28/2024
7.0.19 545,645 5/14/2024
7.0.18 2,471,990 4/9/2024
7.0.17 1,673,019 3/12/2024
7.0.16 2,148,752 2/13/2024
7.0.15 3,353,670 1/9/2024
7.0.14 6,295,204 11/14/2023
7.0.13 7,067,577 10/24/2023
7.0.12 4,523,706 10/10/2023
7.0.11 14,176,710 9/12/2023
7.0.10 9,937,482 8/8/2023
7.0.9 9,337,455 7/11/2023
7.0.8 5,673,194 6/22/2023
7.0.7 3,837,413 6/13/2023
7.0.5 26,339,809 4/11/2023
7.0.4 9,571,768 3/14/2023
7.0.3 14,091,183 2/14/2023
7.0.2 19,311,253 1/10/2023
7.0.1 10,278,194 12/13/2022
7.0.0 32,137,405 11/7/2022
7.0.0-rc.2.22472.11 225,364 10/11/2022
7.0.0-rc.1.22426.7 215,546 9/14/2022
7.0.0-preview.7.22376.2 99,543 8/9/2022
7.0.0-preview.6.22329.4 77,741 7/12/2022
7.0.0-preview.5.22302.2 65,719 6/14/2022
7.0.0-preview.4.22229.2 88,400 5/10/2022
7.0.0-preview.3.22175.1 79,234 4/13/2022
7.0.0-preview.2.22153.1 86,499 3/14/2022
7.0.0-preview.1.22076.6 58,936 2/17/2022
6.0.36 1,662,894 11/12/2024
6.0.35 720,507 10/8/2024
6.0.33 1,908,954 8/13/2024
6.0.32 833,815 7/9/2024
6.0.31 1,134,756 5/28/2024
6.0.30 624,572 5/14/2024
6.0.29 2,877,940 4/9/2024
6.0.28 1,660,242 3/12/2024
6.0.27 1,937,536 2/13/2024
6.0.26 2,720,809 1/9/2024
6.0.25 3,750,319 11/14/2023
6.0.24 1,930,210 10/24/2023
6.0.23 1,265,789 10/10/2023
6.0.22 3,453,646 9/12/2023
6.0.21 3,680,365 8/8/2023
6.0.20 2,947,844 7/11/2023
6.0.19 2,471,131 6/22/2023
6.0.18 1,306,005 6/13/2023
6.0.16 7,758,776 4/11/2023
6.0.15 4,270,677 3/14/2023
6.0.14 5,385,423 2/14/2023
6.0.13 7,063,631 1/10/2023
6.0.12 11,064,281 12/13/2022
6.0.11 10,100,938 11/7/2022
6.0.10 17,817,886 10/11/2022
6.0.9 15,535,045 9/13/2022
6.0.8 18,732,338 8/9/2022
6.0.7 50,636,011 7/12/2022
6.0.6 15,061,950 6/14/2022
6.0.5 22,917,749 5/10/2022
6.0.4 18,162,358 4/11/2022
6.0.3 25,397,764 3/8/2022
6.0.2 20,057,053 2/8/2022
6.0.1 33,489,044 12/14/2021
6.0.0 71,835,977 11/8/2021
6.0.0-rc.2.21480.5 331,749 10/12/2021
6.0.0-rc.1.21452.10 271,842 9/14/2021
6.0.0-preview.7.21378.4 100,998 8/10/2021
6.0.0-preview.6.21352.1 44,646 7/14/2021
6.0.0-preview.5.21301.9 190,286 6/15/2021
6.0.0-preview.4.21253.1 78,831 5/24/2021
6.0.0-preview.3.21201.2 101,857 4/8/2021
6.0.0-preview.2.21154.2 75,101 3/11/2021
6.0.0-preview.1.21102.2 97,786 2/12/2021
5.0.17 7,979,099 5/10/2022 5.0.17 is deprecated because it is no longer maintained.
5.0.16 1,520,896 4/11/2022 5.0.16 is deprecated because it is no longer maintained.
5.0.15 2,370,812 3/8/2022 5.0.15 is deprecated because it is no longer maintained.
5.0.14 2,388,964 2/8/2022 5.0.14 is deprecated because it is no longer maintained.
5.0.13 4,532,825 12/14/2021 5.0.13 is deprecated because it is no longer maintained.
5.0.12 4,897,319 11/7/2021 5.0.12 is deprecated because it is no longer maintained.
5.0.11 8,538,714 10/12/2021 5.0.11 is deprecated because it is no longer maintained.
5.0.10 13,699,694 9/14/2021 5.0.10 is deprecated because it is no longer maintained.
5.0.9 10,496,467 8/10/2021 5.0.9 is deprecated because it is no longer maintained.
5.0.8 9,823,614 7/13/2021 5.0.8 is deprecated because it is no longer maintained.
5.0.7 14,732,650 6/8/2021 5.0.7 is deprecated because it is no longer maintained.
5.0.6 8,336,907 5/11/2021 5.0.6 is deprecated because it is no longer maintained.
5.0.5 11,646,919 4/6/2021 5.0.5 is deprecated because it is no longer maintained.
5.0.4 8,430,902 3/9/2021 5.0.4 is deprecated because it is no longer maintained.
5.0.3 8,179,600 2/9/2021 5.0.3 is deprecated because it is no longer maintained.
5.0.2 10,645,536 1/12/2021 5.0.2 is deprecated because it is no longer maintained.
5.0.1 16,270,230 12/8/2020 5.0.1 is deprecated because it is no longer maintained.
5.0.0 27,489,390 11/9/2020 5.0.0 is deprecated because it is no longer maintained.
5.0.0-rc.2.20475.6 387,402 10/13/2020
5.0.0-rc.1.20451.13 322,397 9/14/2020
5.0.0-preview.8.20407.4 208,293 8/25/2020
5.0.0-preview.7.20365.15 118,211 7/21/2020
5.0.0-preview.6.20312.4 64,200 6/25/2020
5.0.0-preview.5.20278.2 50,483 6/10/2020
5.0.0-preview.4.20220.10 74,350 5/18/2020
5.0.0-preview.3.20181.2 95,096 4/23/2020
5.0.0-preview.2.20159.4 62,147 4/2/2020
5.0.0-preview.2.20120.8 46,300 3/16/2020
3.1.32 6,514,116 12/13/2022
3.1.31 1,304,203 11/8/2022
3.1.30 782,250 10/11/2022
3.1.29 1,378,346 9/13/2022
3.1.28 890,206 8/9/2022
3.1.27 770,040 7/12/2022
3.1.26 683,493 6/14/2022
3.1.25 1,124,246 5/10/2022
3.1.24 670,751 4/11/2022
3.1.23 1,095,064 3/8/2022
3.1.22 3,603,112 12/14/2021
3.1.21 2,685,113 11/7/2021
3.1.20 1,657,377 10/11/2021
3.1.19 2,523,260 9/14/2021
3.1.18 5,500,060 8/10/2021
3.1.17 1,933,092 7/13/2021
3.1.16 2,428,044 6/8/2021
3.1.15 2,932,206 5/11/2021
3.1.14 3,168,773 4/6/2021
3.1.13 4,731,682 3/9/2021
3.1.12 3,054,166 2/9/2021
3.1.11 5,545,577 1/12/2021
3.1.10 8,449,064 11/9/2020
3.1.9 12,208,783 10/13/2020
3.1.8 17,881,105 9/8/2020
3.1.7 10,277,016 8/11/2020
3.1.6 10,945,739 7/14/2020
3.1.5 13,028,163 6/9/2020
3.1.4 18,226,029 5/12/2020
3.1.3 28,450,100 3/24/2020
3.1.2 12,074,598 2/19/2020
3.1.1 20,360,933 1/14/2020
3.1.0 35,003,639 12/3/2019
3.1.0-preview3.19554.8 165,398 11/13/2019
3.1.0-preview2.19525.5 32,923 11/1/2019
3.1.0-preview1.19506.2 772,397 10/15/2019
3.0.3 193,571 2/19/2020
3.0.2 80,900 1/14/2020
3.0.1 1,417,891 11/18/2019
3.0.0 19,361,741 9/23/2019
3.0.0-rc1.19456.14 46,903 9/16/2019
3.0.0-preview9.19423.6 1,390,158 9/4/2019
3.0.0-preview8.19405.11 413,008 8/13/2019
3.0.0-preview7.19362.6 92,123 7/23/2019
3.0.0-preview6.19304.10 168,492 6/12/2019
3.0.0-preview5.19227.1 672,432 5/6/2019
3.0.0-preview4.19216.3 23,173 4/18/2019
3.0.0-preview3.19153.1 202,799 3/6/2019
3.0.0-preview.19074.3 32,126 1/29/2019
3.0.0-preview.18572.1 48,839 12/3/2018
2.3.0 22,066 1/14/2025
2.2.6 32,167,225 7/9/2019 2.2.6 is deprecated because it is no longer maintained.
2.2.4 19,695,225 4/9/2019 2.2.4 is deprecated because it is no longer maintained.
2.2.3 5,382,876 3/11/2019 2.2.3 is deprecated because it is no longer maintained.
2.2.2 6,482,756 2/12/2019 2.2.2 is deprecated because it is no longer maintained.
2.2.1 6,937,024 1/8/2019 2.2.1 is deprecated because it is no longer maintained.
2.2.0 22,153,790 12/3/2018 2.2.0 is deprecated because it is no longer maintained.
2.2.0-preview3-35497 185,249 10/17/2018
2.2.0-preview2-35157 151,571 9/12/2018
2.2.0-preview1-35029 84,074 8/22/2018
2.1.14 4,050,067 11/18/2019
2.1.11 3,718,385 5/14/2019
2.1.8 3,827,307 2/12/2019
2.1.4 15,654,753 10/1/2018
2.1.3 4,918,413 9/11/2018
2.1.2 8,154,301 8/21/2018
2.1.1 16,916,465 6/18/2018
2.1.0 13,404,204 5/29/2018
2.1.0-rc1-final 224,883 5/6/2018
2.1.0-preview2-final 206,162 4/10/2018
2.1.0-preview1-final 318,459 2/26/2018
2.0.3 5,406,223 5/7/2018 2.0.3 is deprecated because it is no longer maintained.
2.0.2 6,748,280 3/13/2018 2.0.2 is deprecated because it is no longer maintained.
2.0.1 12,663,015 11/14/2017 2.0.1 is deprecated because it is no longer maintained.
2.0.0 27,739,552 8/11/2017 2.0.0 is deprecated because it is no longer maintained.
2.0.0-preview2-final 96,604 6/28/2017 2.0.0-preview2-final is deprecated because it is no longer maintained.
2.0.0-preview1-final 1,131,579 5/10/2017 2.0.0-preview1-final is deprecated because it is no longer maintained.
1.1.6 6,060,720 7/10/2018 1.1.6 is deprecated because it is no longer maintained.
1.1.5 1,253,824 12/12/2017 1.1.5 is deprecated because it is no longer maintained.
1.1.4 227,587 11/14/2017 1.1.4 is deprecated because it is no longer maintained.
1.1.3 309,588 9/20/2017 1.1.3 is deprecated because it is no longer maintained.
1.1.2 5,110,534 5/9/2017 1.1.2 is deprecated because it is no longer maintained.
1.1.1 3,281,687 3/6/2017 1.1.1 is deprecated because it is no longer maintained.
1.1.0 7,695,296 11/16/2016 1.1.0 is deprecated because it is no longer maintained.
1.1.0-preview1-final 46,744 10/24/2016 1.1.0-preview1-final is deprecated because it is no longer maintained.
1.0.6 55,369 11/14/2017 1.0.6 is deprecated because it is no longer maintained.
1.0.5 43,685 9/20/2017 1.0.5 is deprecated because it is no longer maintained.
1.0.4 58,469 5/9/2017 1.0.4 is deprecated because it is no longer maintained.
1.0.3 678,440 3/6/2017 1.0.3 is deprecated because it is no longer maintained.
1.0.2 78,674 12/12/2016 1.0.2 is deprecated because it is no longer maintained.
1.0.1 828,460 9/13/2016 1.0.1 is deprecated because it is no longer maintained.
1.0.0 1,922,042 6/27/2016 1.0.0 is deprecated because it is no longer maintained.
1.0.0-rc2-final 143,982 5/16/2016 1.0.0-rc2-final is deprecated because it is no longer maintained.