EF Core 工具和扩展EF Core Tools & Extensions

这些工具和扩展为 Framework Core 2.1 及更高版本提供了附加功能。These tools and extensions provide additional functionality for Entity Framework Core 2.1 and later.


扩展由各种源构建,不作为 Entity Framework Core 项目的一部分进行维护。Extensions are built by a variety of sources and aren't maintained as part of the Entity Framework Core project. 考虑使用第三方扩展时,请务必评估其质量、授权、兼容性和支持等因素,确保其符合要求。When considering a third party extension, be sure to evaluate its quality, licensing, compatibility, support, etc. to ensure it meets your requirements. 具体而言,为更早版本的 EF Core 构建的扩展可能需要更新,然后才适用于最新版本。In particular, an extension built for an older version of EF Core may need updating before it will work with the latest versions.



LLBLGen Pro 是一种实体建模解决方案,包含对 Entity Framework 和 Entity Framework Core 的支持。LLBLGen Pro is an entity modeling solution with support for Entity Framework and Entity Framework Core. 借助它可轻松通过 Database First 或 Model First 定义实体模型并将其映射到数据库中,使你可以立即开始编写查询。It lets you easily define your entity model and map it to your database, using database first or model first, so you can get started writing queries right away. 对于 EF Core:2、3For EF Core: 2, 3


Devart Entity DeveloperDevart Entity Developer

Devart Entity Developer 是一种用于 ADO.NET 实体框架、NHibernate、LinqConnect、Telerik 数据访问和 LINQ to SQL 的强大 ORM 设计器。Entity Developer is a powerful ORM designer for ADO.NET Entity Framework, NHibernate, LinqConnect, Telerik Data Access, and LINQ to SQL. 它支持 EF Core 模型的直观设计、使用“模型优先”或“数据库优先”的方式,还支持 C# 或 Visual Basic 代码生成。It supports designing EF Core models visually, using model first or database first approaches, and C# or Visual Basic code generation. 对于 EF Core:1、2、3、5。For EF Core: 1, 2, 3, 5.


用于 Entity Framework 的 nHydrate ORMnHydrate ORM for Entity Framework

为 Entity Framework 创建强类型的可扩展类的 ORM。An ORM that creates strongly-typed, extendable classes for Entity Framework. 生成的代码为 Entity Framework Core。The generated code is Entity Framework Core. 二者没有任何区别。There is no difference. 这不能替代 EF 或自定义 ORM。This is not a replacement for EF or a custom ORM. 它是一种视觉对象建模层,可让团队管理复杂的数据库架构。It is a visual, modeling layer that allows a team to manage complex database schemas. 它适用于 Git 等 SCM 软件,允许多用户访问你的模型,并最大限度减少冲突。It works well with SCM software like Git, allowing multi-user access to your model with minimal conflicts. 安装程序可跟踪模型更改并创建升级脚本。The installer tracks model changes and creates upgrade scripts. 对于 EF Core:3.For EF Core: 3.

Github 站点Github site

EF Core Power ToolsEF Core Power Tools

EF Core Power Tools 是一种 Visual Studio 扩展,它在简单用户界面中公开各种 EF Core 设计时任务。EF Core Power Tools is a Visual Studio extension that exposes various EF Core design-time tasks in a simple user interface. 其中包括对现有数据库和 SQL Server DACPAC 中的 DbContext 和实体类的反向工程、对数据库迁移的管理,以及模型可视化效果。It includes reverse engineering of DbContext and entity classes from existing databases and SQL Server DACPACs, management of database migrations, and model visualizations. 对于 EF Core:2、3。For EF Core: 2, 3.

GitHub wikiGitHub wiki

实体框架可视化编辑器Entity Framework Visual Editor

Entity Framework Visual Editor 是一种 Visual Studio 扩展,其中增添了 ORM 设计器用于 EF 6 和 EF Core 类的可视化设计。Entity Framework Visual Editor is a Visual Studio extension that adds an ORM designer for visual design of EF 6, and EF Core classes. 代码是通过 T4 模板生成的,因此可自定义来满足任意需求。Code is generated using T4 templates so can be customized to suit any needs. 它支持继承、单向和双向关联,支持枚举,还能用颜色标识类并添加文本块来解释潜在不可预测的设计部分。It supports inheritance, unidirectional and bidirectional associations, enumerations, and the ability to color-code your classes and add text blocks to explain potentially arcane parts of your design. 对于 EF Core:2.For EF Core: 2.



CatFactory 是一种面向 .NET Core 的基架引擎,它可自动基于 SQL Server 数据库生成 DbContext 类、实体、映射配置和存储库类。CatFactory is a scaffolding engine for .NET Core that can automate the generation of DbContext classes, entities, mapping configurations, and repository classes from a SQL Server database. 对于 EF Core:2.For EF Core: 2.

GitHub 存储库GitHub repository

LoreSoft 的 Entity Framework Core 生成器LoreSoft's Entity Framework Core Generator

Entity Framework Core Generator (efg) 是一种 .NET Core CLI 工具,可基于现有数据库生成 EF Core 模型,其功能与 dotnet ef dbcontext scaffold 很相似,但它还支持通过区域替换或分析映射文件来实现安全代码的重新生成Entity Framework Core Generator (efg) is a .NET Core CLI tool that can generate EF Core models from an existing database, much like dotnet ef dbcontext scaffold, but it also supports safe code regeneration via region replacement or by parsing mapping files. 此工具支持生成视图模型、验证和对象映射器代码。This tool supports generating view models, validation, and object mapper code. 对于 EF Core:2.For EF Core: 2.

教程 文档Tutorial Documentation



一个插件库,它可用于将 EF Core 执行的数据更改自动记录到历史记录表中。A plugin library that enables automatically recording the data changes performed by EF Core into a history table. 对于 EF Core:2.For EF Core: 2.

GitHub 存储库GitHub repository


二级缓存是一个查询缓存。Second level caching is a query cache. EF 命令的结果将存储在该缓存中,这样相同的 EF 命令将从该缓存检索其数据,而不是再次针对数据库进行执行。The results of EF commands will be stored in the cache, so that the same EF commands will retrieve their data from the cache rather than executing them against the database again. 对于 EF Core:3.For EF Core: 3.

GitHub 存储库GitHub repository


Geco(生成器控制台)是一个基于控制台项目的简单代码生成器,它在 .NET Core 上运行并使用 C# 内插字符串来生成代码。Geco (Generator Console) is a simple code generator based on a console project, that runs on .NET Core and uses C# interpolated strings for code generation. Geco 提供面向 EF Core 的反向模型生成器,并支持复数形式、单数形式和可编辑的模板。Geco includes a reverse model generator for EF Core with support for pluralization, singularization, and editable templates. 它还支持种子数据脚本生成器、脚本运行器和数据库清理器。It also provides a seed data script generator, a script runner, and a database cleaner. 对于 EF Core:2.For EF Core: 2.

GitHub 存储库GitHub repository


允许结合使用 Entity Framework Core 工具链和 Handlebars 模板对基于现有数据库反向工程处理的类进行自定义。Allows customization of classes reverse engineered from an existing database using the Entity Framework Core toolchain with Handlebars templates. 对于 EF Core:2、3。For EF Core: 2, 3.

GitHub 存储库GitHub repository


NeinLinq 扩展了 Entity Framewor 等 LINQ 提供程序,让用户能够使用可转换谓词和选择器重复使用函数、重新编写查询并构建动态查询。NeinLinq extends LINQ providers such as Entity Framework to enable reusing functions, rewriting queries, and building dynamic queries using translatable predicates and selectors. 对于 EF Core:2、3。For EF Core: 2, 3.

GitHub 存储库GitHub repository


Microsoft.EntityFrameworkCore 的一个插件,它支持存储库、工作模式单元,并支持多个具有具有所支持分布式事务的数据库。A plugin for Microsoft.EntityFrameworkCore to support repository, unit of work patterns, and multiple databases with distributed transaction supported. 对于 EF Core:2.For EF Core: 2.

GitHub 存储库GitHub repository


用于批量操作(插入、更新和删除)的 EF Core 插件。EF Core extensions for Bulk operations (Insert, Update, Delete). 对于 EF Core:2、3。For EF Core: 2, 3.

GitHub 存储库GitHub repository


添加设计时复数形式。Adds design-time pluralization. 对于 EF Core:2.For EF Core: 2.

GitHub 存储库GitHub repository


恢复 [Index] 属性(带有用于模型构建的扩展)。Revival of [Index] attribute (with extension for model building). 对于 EF Core:2、3。For EF Core: 2, 3.

GitHub 存储库GitHub repository


提供一个面向 EF Core 内存中数据库提供程序的包装器。Provides a wrapper around the EF Core In-Memory Database Provider. 使其功能与关系提供程序更类似。Makes it act more like a relational provider. 对于 EF Core:2.For EF Core: 2.

GitHub 存储库GitHub repository


对时态支持的实现。An implementation of temporal support. 对于 EF Core:2.For EF Core: 2.

GitHub 存储库GitHub repository


使用下列引入的扩展方法对你喜爱的数据库轻松执行时态查询:AsTemporalAll()AsTemporalAsOf(date)AsTemporalFrom(startDate, endDate)AsTemporalBetween(startDate, endDate)AsTemporalContained(startDate, endDate)Easily perform temporal queries on your favourite database using introduced extension methods: AsTemporalAll(), AsTemporalAsOf(date), AsTemporalFrom(startDate, endDate), AsTemporalBetween(startDate, endDate), AsTemporalContained(startDate, endDate). 对于 EF Core:3.For EF Core: 3.

GitHub 存储库GitHub repository


允许使用你已定义的 EF Core 代码、实体和映射对 SQL Server 时态历史记录执行功能齐全的 Entity Framework Core 查询。Allow full-featured Entity Framework Core queries against SQL Server Temporal History using the EF Core code, entities, and mappings you already have defined. 通过将代码包装到 using (TemporalQuery.AsOf(targetDateTime)) {...} 中按时间顺序查看。Travel through time by wrapping your code in using (TemporalQuery.AsOf(targetDateTime)) {...}. 对于 EF Core:3.For EF Core: 3.

GitHub 存储库GitHub repository


适用于 Entity Framework Core 的扩展库,使用 SQL Server 的开发人员可通过它轻松使用时态表。Extension library for Entity Framework Core which allows developers who use SQL Server to easily use temporal tables. 对于 EF Core:2.For EF Core: 2.

GitHub 存储库GitHub repository


高性能二级查询缓存。A high-performance second-level query cache. 对于 EF Core:2.For EF Core: 2.

GitHub 存储库GitHub repository


NCache Entity Framework Core 提供程序是一个分布式二级缓存提供程序,用于缓存查询结果。NCache Entity Framework Core Provider is a distributed second level cache provider for caching query results. 分布式 NCache 体系结构使其更具伸缩性和高可用性。The distributed architecture of NCache makes it more scalable and highly available. 适用于 EF Core 2。For EF Core 2.


Entity Framework PlusEntity Framework Plus

扩展 DbContext 的功能,例如:包括筛选器、审核、缓存、查询未来、成批删除、批量更新等。Extends your DbContext with features such as: Include Filter, Auditing, Caching, Query Future, Batch Delete, Batch Update, and more. 对于 EF Core:2、3。For EF Core: 2, 3.

网站 GitHub 存储库Website GitHub repository

实体框架扩展Entity Framework Extensions

通过高性能批量操作扩展 DbContext:BulkSaveChanges、BulkInsert、BulkUpdate、BulkDelete、BulkMerge 等。Extends your DbContext with high-performance bulk operations: BulkSaveChanges, BulkInsert, BulkUpdate, BulkDelete, BulkMerge, and more. 对于 EF Core:2、3。For EF Core: 2, 3.



添加了对在 LINQ lambda 中调用扩展方法的支持。Add support for calling extension methods in LINQ lambdas. 对于 EF Core:3.For EF Core: 3.

GitHub 存储库GitHub repository


适用于关系数据库的语言集成查询 (LINQ) 技术。Language Integrated Query (LINQ) technology for relational databases. 它允许你使用 C# 编写强类型查询。It allows you to use C# to write strongly typed queries. 对于 EF Core:3.For EF Core: 3.

  • 完全支持使用 C# 创建查询:可在 lambda 表达式内使用多个语句,还可使用变量、函数等。Full C# support for query creation: multiple statements inside lambda, variables, functions, etc.
  • 与 SQL 之间不存在语义缺口。No semantic gap with SQL. XLinq 将 SQL 语句(如 SELECTFROMWHERE)声明为第一类 C# 方法,将熟悉的语法与 intellisense、类型安全性和重构结合起来。XLinq declares SQL statements (like SELECT, FROM, WHERE) as first class C# methods, combining familiar syntax with intellisense, type safety and refactoring.

因此,SQL 成为了“又一个”本地公开其 API 的类库,可以说是“集成了语言的 SQL”。As a result SQL becomes just "another" class library exposing its API locally, literally "Language Integrated SQL".



生命周期挂钩(用于 SaveChanges)。Lifecycle hooks (for SaveChanges). 对于 EF Core:2、3。For EF Core: 2, 3.

GitHub 存储库GitHub repository


这会自动使所有表和列的名称都有 snake_case、全部大写或全部小写命名。This will automatically make all your table and column names have snake_case, all UPPER or all lower case naming. 对于 EF Core:3.For EF Core: 3.

GitHub 存储库GitHub repository


为 NodaTime 类型的 SQL Server 添加对 EntityFrameworkCore 的本机支持。Adds native support to EntityFrameworkCore for SQL Server for the NodaTime types. 对于 EF Core:3.For EF Core: 3.

GitHub 存储库GitHub repository


Entity Framework Core 3.1 的 LINQ 扩展,目的是支持 Microsoft SQL Server 临时表查询。LINQ extensions to Entity Framework Core 3.1 to support Microsoft SQL Server Temporal Table Querying. 对于 EF Core:3.For EF Core: 3.

GitHub 存储库GitHub repository


向 SQL Server EF Core 提供程序添加 hierarchyid 支持。Adds hierarchyid support to the SQL Server EF Core provider. 对于 EF Core:3.For EF Core: 3.

GitHub 存储库GitHub repository


将 LINQ 查询转换为 SQL 表达式的替换转换器。Alternative translator of LINQ queries to SQL expressions. 对于 EF Core:3.For EF Core: 3.

现已开始支持高级 SQL 功能,如 CTE、大容量复制、表提示、窗口函数、临时表和数据库端创建/更新/删除操作。Includes support for advanced SQL features such as CTEs, bulk copy, table hints, windowed functions, temporary tables, and database-side create/update/delete operations.

GitHub 存储库GitHub repository


软删除实体的实现。An implementation for soft deleting entities. 对于 EF Core:3.For EF Core: 3.