实体框架的过去版本Past Releases of Entity Framework

第一版实体框架在2008中发布,作为 .NET Framework 3.5 SP1 和 Visual Studio 2008 SP1 的一部分。The first version of Entity Framework was released in 2008, as part of .NET Framework 3.5 SP1 and Visual Studio 2008 SP1.

从 EF 4.1 版本开始,该版本已作为 EntityFramework NuGet 包 提供-当前 NuGet.org 上最热门的包之一。Starting with the EF4.1 release it has shipped as the EntityFramework NuGet Package - currently one of the most popular packages on NuGet.org.

在版本4.1 和5.0 之间,EntityFramework NuGet 包扩展了作为 .NET Framework 一部分提供的 EF 库。Between versions 4.1 and 5.0, the EntityFramework NuGet package extended the EF libraries that shipped as part of .NET Framework.

从版本6开始,EF 变成了一个开源项目,同时从 .NET Framework 完全移入。Starting with version 6, EF became an open source project and also moved completely out of band from the .NET Framework. 这意味着,当你将 EntityFramework 版本 6 NuGet 包添加到应用程序时,你将获得 EF 库的完整副本,该副本不依赖于 .NET Framework 附带的 EF 位。This means that when you add the EntityFramework version 6 NuGet package to an application, you are getting a complete copy of the EF library that does not depend on the EF bits that ship as part of .NET Framework. 这有助于在一定程度上加快新功能的开发和交付速度。This helped somewhat accelerate the pace of development and delivery of new features.

2016年6月发布 EF Core 1.0。In June 2016, we released EF Core 1.0. EF Core 基于新的代码库,旨在作为 EF 的更轻型且可扩展的版本。EF Core is based on a new codebase and is designed as a more lightweight and extensible version of EF. 目前 EF Core 是 Microsoft 的实体框架团队开发的主要焦点。Currently EF Core is the main focus of development for the Entity Framework Team at Microsoft. 这意味着没有为 EF6 计划的新的主要功能。This means there are no new major features planned for EF6. 但是,EF6 仍将保持为开源项目和受支持的 Microsoft 产品。However EF6 is still maintained as an open source project and a supported Microsoft product.

下面是过去版本的列表,采用反向时间顺序,其中包含有关每个版本中引入的新功能的信息。Here is the list of past releases, in reverse chronological order, with information on the new features that were introduced in each release.

Visual Studio 2017 15.7 中的 EF 工具更新EF Tools Update in Visual Studio 2017 15.7

2018 年 5 月,我们在 Visual Studio 2017 15.7 中发布了更新后的 EF 工具。In May 2018, we released an updated version of the EF Tools as part of Visual Studio 2017 15.7. 该版本包括对一些常见点的改进:It includes improvements for some common pain points:

  • 修复了多个用户界面辅助功能 bugFixes for several user interface accessibility bugs
  • 从现有数据库生成模型时 SQL Server 性能退化的解决方法 #4Workaround for SQL Server performance regression when generating models from existing databases #4
  • 支持适用于 SQL Server 上较大模型的更新模型 #185Support for updating models for larger models on SQL Server #185

此新版本的 EF 工具中的另一项改进是,在新项目中创建模型时会安装 EF 6.2 运行时。Another improvement in this new version of EF Tools is that it installs the EF 6.2 runtime when creating a model in a new project. 借助较旧版本的 Visual Studio,可通过安装相应版本的 NuGet 包来使用 EF 6.2 运行时(以及以前任何版本的 EF)。With older versions of Visual Studio, it is possible to use the EF 6.2 runtime (as well as any past version of EF) by installing the corresponding version of the NuGet package.

EF 6.2。0EF 6.2.0

EF 6.2 运行时已于 2017 年 10 月发布到 NuGet。The EF 6.2 runtime was released to NuGet in October of 2017. 在我们开源社区参与者的努力下,EF 6.2 包括大量的 bug 修复产品增强功能Thanks in great part to the efforts our community of open source contributors, EF 6.2 includes numerous bugs fixes and product enhancements.

下表简要列出了影响 EF 6.2 运行时的最重要的更改:Here is a brief list of the most important changes affecting the EF 6.2 runtime:

  • 通过加载持久性缓存中已完成的 Code First 模型来加快启动 #275Reduce start up time by loading finished code first models from a persistent cache #275
  • 采用 Fluent API 定义索引 #274Fluent API to define indexes #274
  • 通过 DbFunctions.Like() 编写在 SQL 中转换为 LIKE 的 LINQ 查询 #241DbFunctions.Like() to enable writing LINQ queries that translate to LIKE in SQL #241
  • Migrate.exe 现支持脚本选项 #240Migrate.exe now supports -script option #240
  • EF6 现在可使用 SQL Server 中的序列生成的键值 #165EF6 can now work with key values generated by a sequence in SQL Server #165
  • 更新 SQL Azure 执行策略的暂时性错误列表 #83Update list of transient errors for SQL Azure Execution Strategy #83
  • Bug:重试查询或 SQL 命令失败,“另一 SqlParameterCollection 中已包含 SqlParameter”#81Bug: Retrying queries or SQL commands fails with "The SqlParameter is already contained by another SqlParameterCollection" #81
  • Bug:DbQuery.ToString() 评估在调试程序中经常超时 #73Bug: Evaluation of DbQuery.ToString() frequently times out in the debugger #73

EF EF6.1。3EF 6.1.3

EF ef6.1.3 运行时发布到了2015年10月的 NuGet。The EF 6.1.3 runtime was released to NuGet in October of 2015. 此版本仅包含对6.1.2 版本报告的高优先级缺陷和回归的修补程序。This release contains only fixes to high-priority defects and regressions reported on the 6.1.2 release. 修复包括:The fixes include:

  • 查询: EF 6.1.2 中的回归: OUTER 适用于1:1 关系和 "let" 子句的引入和更复杂的查询Query: Regression in EF 6.1.2: OUTER APPLY introduced and more complex queries for 1:1 relationships and “let” clause
  • 继承类中隐藏基类属性的 TPT 问题TPT problem with hiding base class property in inherited class
  • 当文本中包含单词 "DbMigration" 时,Sql 失败DbMigration.Sql fails when the word ‘go’ is contained in the text
  • 创建供 unionall 和交集平展支持的兼容性标志Create compatibility flag for UnionAll and Intersect flattening support
  • 具有多个包含的查询无法在6.1.2 中工作 (在6.1.1 中工作) Query with multiple Includes does not work in 6.1.2 (working in 6.1.1)
  • 从 EF 6.1.1 升级到6.1.2 后,出现 SQL 语法错误“You have an error in your SQL syntax” exception after upgrading from EF 6.1.1 to 6.1.2

EF 6.1。2EF 6.1.2

EF 6.1.2 运行时已发布到2014年12月的 NuGet。The EF 6.1.2 runtime was released to NuGet in December of 2014. 此版本主要涉及 bug 修复。This version is mostly about bug fixes. 我们还接受了社区成员的几个值得注意的更改:We also accepted a couple of noteworthy changes from members of the community:

  • 可以从应用/web.configu 文件配置查询缓存参数Query cache parameters can be configured from the app/web.configuration file
      <queryCache size='1000' cleaningIntervalInSeconds='-1'/>
  • DbMigration 上的 SqlFile 和 SqlResource 方法 允许您运行存储为文件或嵌入资源的 SQL 脚本。SqlFile and SqlResource methods on DbMigration allow you to run a SQL script stored as a file or embedded resource.

EF 6.1。1EF 6.1.1

EF 6.1.1 运行时已发布到2014年6月。The EF 6.1.1 runtime was released to NuGet in June of 2014. 此版本包含许多人遇到的问题的修补程序。This version contains fixes for issues that a number of people have encountered. 其他:Among others:

  • 设计器:在 EF6 设计器中打开具有十进制精度的 EF5 edmx 时出错Designer: Error opening EF5 edmx with decimal precision in EF6 designer
  • LocalDB 的默认实例检测逻辑不适用于 SQL Server 2014Default instance detection logic for LocalDB doesn't work with SQL Server 2014

EF 6.1。0EF 6.1.0

EF 6.1.0 运行时发布到了2014年3月的 NuGet。The EF 6.1.0 runtime was released to NuGet in March of 2014. 此次要更新包含大量新功能:This minor update includes a significant number of new features:

  • 工具合并 为创建新的 EF 模型提供了一种一致的方法。Tooling consolidation provides a consistent way to create a new EF model. 此功能 扩展了 ADO.NET 实体数据模型向导以支持创建 Code First 模型,包括从现有数据库进行反向工程。This feature extends the ADO.NET Entity Data Model wizard to support creating Code First models, including reverse engineering from an existing database. 这些功能之前已在 EF Power Tools 中提供 Beta 版质量。These features were previously available in Beta quality in the EF Power Tools.
  • 处理事务提交失败 会提供 CommitFailureHandler,它利用新引入的截取事务操作的能力。Handling of transaction commit failures provides the CommitFailureHandler which makes use of the newly introduced ability to intercept transaction operations. CommitFailureHandler 允许在提交事务的同时从连接故障中自动恢复。The CommitFailureHandler allows automatic recovery from connection failures whilst committing a transaction.
  • IndexAttribute 允许通过 [Index]) Code First 模型中的属性 (或属性来指定索引。IndexAttribute allows indexes to be specified by placing an [Index] attribute on a property (or properties) in your Code First model. 然后 Code First 将在数据库中创建相应的索引。Code First will then create a corresponding index in the database.
  • 公共映射 API 提供对信息 EF 的访问,以了解如何将属性和类型映射到数据库中的列和表。The public mapping API provides access to the information EF has on how properties and types are mapped to columns and tables in the database. 在以前的版本中,此 API 是内部的。In past releases this API was internal.
  • 通过应用/Web.config 文件配置侦听器的能力 允许添加侦听器,而无需重新编译应用程序。Ability to configure interceptors via the App/Web.config file allows interceptors to be added without recompiling the application.
  • DatabaseLogger是一个新的侦听器,可让你轻松地将所有数据库操作记录到文件中。System.Data.Entity.Infrastructure.Interception.DatabaseLoggeris a new interceptor that makes it easy to log all database operations to a file. 与上一项功能结合使用,可以轻松地针对已 部署的应用程序的数据库操作进行日志记录,而无需重新编译。In combination with the previous feature, this allows you to easily switch on logging of database operations for a deployed application, without the need to recompile.
  • 改进了迁移模型更改检测,使基架迁移更准确;还增强了更改检测过程的性能。Migrations model change detection has been improved so that scaffolded migrations are more accurate; performance of the change detection process has also been enhanced.
  • 性能改进 ,包括在初始化期间减少数据库操作、在 LINQ 查询中优化 null 相等比较、更快速地 (模型创建) 在更多情况下,以及更高效地具体化具有多个关联的跟踪实体。Performance improvements including reduced database operations during initialization, optimizations for null equality comparison in LINQ queries, faster view generation (model creation) in more scenarios, and more efficient materialization of tracked entities with multiple associations.

EF 6.0。2EF 6.0.2

EF 6.0.2 运行时已发布到2013年12月的 NuGet。The EF 6.0.2 runtime was released to NuGet in December of 2013. 此修补程序版本限制为修复 EF6 版本中引入的问题, (性能/行为中的回归,因为 EF5) 。This patch release is limited to fixing issues that were introduced in the EF6 release (regressions in performance/behavior since EF5).

EF 6.0。1EF 6.0.1

EF 6.0.1 运行时已发布到2013年10月的 NuGet,因为后者嵌入到了几个月之前的 Visual Studio 版本中。The EF 6.0.1 runtime was released to NuGet in October of 2013 simultaneously with EF 6.0.0, because the latter was embedded in a version of Visual Studio that had locked down a few months before. 此修补程序版本限制为修复 EF6 版本中引入的问题, (性能/行为中的回归,因为 EF5) 。This patch release is limited to fixing issues that were introduced in the EF6 release (regressions in performance/behavior since EF5). 最值得注意的更改是解决 EF 模型的预热过程中的某些性能问题。The most notable changes were to fix some performance issues during warm-up for EF models. 这一点非常重要,因为预热性能是 EF6 的一个重点领域,而这些问题取消 EF6 的一些其他性能。This was important as warm-up performance was an area of focus in EF6 and these issues were negating some of the other performance gains made in EF6.

EF 6。0EF 6.0

EF 6.0.0 运行时发布到了2013年10月的 NuGet。The EF 6.0.0 runtime was released to NuGet in October of 2013. 这是 EntityFramework NuGet 包 中的第一个版本,在该版本中,不依赖于 .NET Framework 中的 EF 位。This is the first version in which a complete EF runtime is included in the EntityFramework NuGet Package which does not depend on the EF bits that are part of the .NET Framework. 将运行时的剩余部分移到 NuGet 包需要对现有代码进行大量的重大更改。Moving the remaining parts of the runtime to the NuGet package required a number of breaking change for existing code. 有关升级所需的手动步骤的详细信息,请参阅 升级到实体框架 6 部分。See the section on Upgrading to Entity Framework 6 for more details on the manual steps required to upgrade.

此版本包含许多新功能。This release includes numerous new features. 以下功能适用于使用 Code First 或 EF 设计器创建的模型:The following features work for models created with Code First or the EF Designer:

  • 异步查询和保存 增加了对 .net 4.5 中引入的基于任务的异步模式的支持。Async Query and Save adds support for the task-based asynchronous patterns that were introduced in .NET 4.5.
  • 连接复原 允许从暂时性连接故障中自动恢复。Connection Resiliency enables automatic recovery from transient connection failures.
  • 基于代码的配置 使你能够在代码中执行配置(传统上在配置文件中执行)。Code-Based Configuration gives you the option of performing configuration – that was traditionally performed in a config file – in code.
  • 依赖项解析 引入了对服务定位器模式的支持,并分解了某些功能,这些功能可以替换为自定义实现。Dependency Resolution introduces support for the Service Locator pattern and we've factored out some pieces of functionality that can be replaced with custom implementations.
  • 拦截/SQL 日志记录 提供低级别的构建基块,用于截获 EF 操作,同时构建简单的 SQL 日志记录。Interception/SQL logging provides low-level building blocks for interception of EF operations with simple SQL logging built on top.
  • 使用模拟 framework编写你自己的测试时,可测试性改进可以更轻松地为 DbContext 和 DbSet 创建测试双精度。Testability improvements make it easier to create test doubles for DbContext and DbSet when using a mocking framework or writing your own test doubles.
  • 现在可以使用已打开的 DbConnection 创建 DbContext, 这会启用在创建上下文时可以打开连接的方案 (例如,在无法保证连接状态的组件之间共享连接) 。DbContext can now be created with a DbConnection that is already opened which enables scenarios where it would be helpful if the connection could be open when creating the context (such as sharing a connection between components where you can not guarantee the state of the connection).
  • 改进的事务支持 为框架的外部事务提供支持,并改进了在框架中创建事务的方式。Improved Transaction Support provides support for a transaction external to the framework as well as improved ways of creating a transaction within the Framework.
  • .Net 4.0 上的枚举、空间和更好的性能 -通过将已在 .NET Framework 中的核心组件移到 EF NuGet 包中,我们现在可以提供枚举支持、空间数据类型和 .net 4.0 上 EF5 的性能改进。Enums, Spatial and Better Performance on .NET 4.0 - By moving the core components that used to be in the .NET Framework into the EF NuGet package we are now able to offer enum support, spatial data types and the performance improvements from EF5 on .NET 4.0.
  • 枚举的性能得到改进。包含在 LINQ 查询中Improved performance of Enumerable.Contains in LINQ queries.
  • **改善了 (视图生成) 的预热时间 **,尤其是对于大型模型。Improved warm up time (view generation), especially for large models.
  • 插入复数形式 &Singularization 服务Pluggable Pluralization & Singularization Service.
  • 现在支持实体类上Equals 或 GetHashCode 的自定义实现Custom implementations of Equals or GetHashCode on entity classes are now supported.
  • DbSet. AddRange/RemoveRange 提供一种优化的方式来添加或删除集中的多个实体。DbSet.AddRange/RemoveRange provides an optimized way to add or remove multiple entities from a set.
  • DbChangeTracker HasChanges 提供一种简单有效的方法来查看是否有任何挂起的更改保存到数据库中。DbChangeTracker.HasChanges provides an easy and efficient way to see if there are any pending changes to be saved to the database.
  • SqlCeFunctions 提供与 SqlFunctions 等效的 SQL Compact。SqlCeFunctions provides a SQL Compact equivalent to the SqlFunctions.

以下功能仅适用于 Code First:The following features apply to Code First only:

  • 自定义 Code First 约定 允许编写自己的约定,以帮助避免重复配置。Custom Code First Conventions allow write your own conventions to help avoid repetitive configuration. 我们提供了一个简单的轻型约定 API 以及一些更复杂的构建基块,使你能够创作更复杂的约定。We provide a simple API for lightweight conventions as well as some more complex building blocks to allow you to author more complicated conventions.
  • 现在支持**Code First 映射到插入/更新/删除存储过程Code First Mapping to Insert/Update/Delete Stored Procedures** is now supported.
  • 幂等迁移脚本 允许生成一个 SQL 脚本,该脚本可以将任何版本的数据库升级到最新版本。Idempotent migrations scripts allow you to generate a SQL script that can upgrade a database at any version up to the latest version.
  • 可**配置的迁移历史记录表** 允许自定义迁移历史记录表的定义。Configurable Migrations History Table allows you to customize the definition of the migrations history table. 这对于需要适当的数据类型等的数据库提供程序特别有用,因为需要为迁移历史记录表指定这些数据类型才能正常工作。This is particularly useful for database providers that require the appropriate data types etc. to be specified for the Migrations History table to work correctly.
  • 当使用迁移时,或 Code First 自动为您创建数据库时,每个数据库的多个上下文将删除每个数据库的一个 Code First 模型的以前限制。Multiple Contexts per Database removes the previous limitation of one Code First model per database when using Migrations or when Code First automatically created the database for you.
  • DbModelBuilder 是一个新的 Code First API,它允许在一个位置配置 Code First 模型的默认数据库架构。DbModelBuilder.HasDefaultSchema is a new Code First API that allows the default database schema for a Code First model to be configured in one place. 以前 Code First 的默认架构已硬编码为 " dbo " ,而唯一的方法是通过 ToTable API 配置表所属的架构。Previously the Code First default schema was hard-coded to "dbo" and the only way to configure the schema to which a table belonged was via the ToTable API.
  • DbModelBuilder.Configurations。Code First 使用 AddFromAssembly 方法 时,可以轻松地添加程序集中定义的所有配置类。DbModelBuilder.Configurations.AddFromAssembly method allows you to easily add all configuration classes defined in an assembly when you are using configuration classes with the Code First Fluent API.
  • 自定义迁移操作 使您能够添加要在基于代码的迁移中使用的其他操作。Custom Migrations Operations enabled you to add additional operations to be used in your code-based migrations.
  • 对于使用 Code First 创建的数据库,默认事务隔离级别将更改为 READ_COMMITTED_SNAPSHOT ,从而实现更高的可伸缩性和更少的死锁。Default transaction isolation level is changed to READ_COMMITTED_SNAPSHOT for databases created using Code First, allowing for more scalability and fewer deadlocks.
  • 实体和复杂类型现在可以是 nestedinside 类Entity and complex types can now be nestedinside classes.

EF 5。0EF 5.0

2012年8月发布了 EF 5.0.0 运行时。The EF 5.0.0 runtime was released to NuGet in August of 2012. 此版本引入了一些新功能,包括枚举支持、表值函数、空间数据类型和各种性能改进。This release introduces some new features including enum support, table-valued functions, spatial data types and various performance improvements.

Visual Studio 2012 中的 Entity Framework Designer 还引入了对每个模型的多个关系图的支持、设计图面上的形状的颜色以及存储过程的批处理导入。The Entity Framework Designer in Visual Studio 2012 also introduces support for multiple-diagrams per model, coloring of shapes on the design surface and batch import of stored procedures.

下面是专门为 EF 5 版本组合在一起的内容列表:Here is a list of content we put together specifically for the EF 5 release:

EF 4.3。1EF 4.3.1

Ef 4.3.1 运行时在 EF 4.3.0 之后不久发布到 2012 NuGet。The EF 4.3.1 runtime was released to NuGet in February 2012 shortly after EF 4.3.0. 此修补版本包含对 EF 4.3 版本的一些 bug 修复,并为使用 EF 4.3 与 Visual Studio 2012 的客户引入更好的 LocalDB 支持。This patch release included some bug fixes to the EF 4.3 release and introduced better LocalDB support for customers using EF 4.3 with Visual Studio 2012.

下面是专门为 EF 4.3.1 版本组合在一起的内容列表,为 EF 4.1 提供的大多数内容也适用于 EF 4.3:Here is a list of content we put together specifically for the EF 4.3.1 release, most of the content provided for EF 4.1 still applies to EF 4.3 as well:

EF 4。3EF 4.3

EF 4.3.0 运行时已发布到2012年2月的 NuGet。The EF 4.3.0 runtime was released to NuGet in February of 2012. 此版本包含新的 Code First 迁移功能,该功能允许增量更改 Code First 创建的数据库,因为 Code First 模型演变。This release included the new Code First Migrations feature that allows a database created by Code First to be incrementally changed as your Code First model evolves.

下面是专为 EF 4.3 版本组合在一起的内容列表,为 EF 4.1 提供的大多数内容也适用于 EF 4.3:Here is a list of content we put together specifically for the EF 4.3 release, most of the content provided for EF 4.1 still applies to EF 4.3 as well:

EF 4。2EF 4.2

EF 4.2.0 运行时已发布到2011年11月的 NuGet。The EF 4.2.0 runtime was released to NuGet in November of 2011. 此版本包含对 EF 4.1.1 版本的 bug 修复。This release includes bug fixes to the EF 4.1.1 release. 由于此发行版只包含 bug 修复,因此,它可能已成为 EF 4.1.2 修补程序版本,但我们选择迁移到4.2,以允许我们从在4.1 版本中使用的基于日期的修补程序版本号开始,并采用 语义 Versionsing 标准进行语义版本控制。Because this release only included bug fixes it could have been the EF 4.1.2 patch release but we opted to move to 4.2 to allow us to move away from the date based patch version numbers we used in the 4.1.x releases and adopt the Semantic Versionsing standard for semantic versioning.

下面是专为 EF 4.2 版本组合在一起的内容列表,为 EF 4.1 提供的内容也适用于 EF 4.2:Here is a list of content we put together specifically for the EF 4.2 release, the content provided for EF 4.1 still applies to EF 4.2 as well:

EF 4.1。1EF 4.1.1

EF 4.1.10715 运行时已发布到2011年7月的 NuGet。The EF 4.1.10715 runtime was released to NuGet in July of 2011. 除了 bug 修复外,此修补程序版本还引入了一些组件,使设计时工具可以更轻松地处理 Code First 模型。In addition to bug fixes this patch release introduced some components to make it easier for design time tooling to work with a Code First model. 这些组件由 EF 4.3) 中包含的 Code First 迁移 (和 EF 功能工具使用。These components are used by Code First Migrations (included in EF 4.3) and the EF Power Tools.

你会注意到,包的异常版本号4.1.10715。You’ll notice that the strange version number 4.1.10715 of the package. 我们在决定采用 语义版本控制之前,使用基于日期的修补程序版本。We used to use date based patch versions before we decided to adopt Semantic Versioning. 将此版本视为 EF 4.1 修补程序 1 (或 EF 4.1.1) 。Think of this version as EF 4.1 patch 1 (or EF 4.1.1).

下面是我们将4.1.1 版本组合在一起的内容列表:Here is a list of content we put together for the 4.1.1 release:

EF 4。1EF 4.1

EF 4.1.10331 运行时是第一次在 NuGet 上发布,2011年4月。The EF 4.1.10331 runtime was the first to be published on NuGet, in April of 2011. 此版本包括简化的 DbContext API 和 Code First 的工作流。This release included the simplified DbContext API and the Code First workflow.

你会注意到奇怪的版本号,4.1.10331,其实际为4.1。You will notice the strange version number, 4.1.10331, which should really have been 4.1. 此外,还有一个4.1.10311 版本,该版本应为 4.1.0-rc ("rc" 代表 "候选候选" ) 。In addition there is a 4.1.10311 version which should have been 4.1.0-rc (the ‘rc’ stands for ‘release candidate’). 我们在决定采用 语义版本控制之前,使用基于日期的修补程序版本。We used to use date based patch versions before we decided to adopt Semantic Versioning.

下面是我们为4.1 版本组合在一起的内容列表。Here is a list of content we put together for the 4.1 release. 很多情况仍适用于实体框架的更高版本:Much of it still applies to later releases of Entity Framework:

EF 4。0EF 4.0

此版本包含在2010的4月 .NET Framework 4 和 Visual Studio 2010 中。This release was included in .NET Framework 4 and Visual Studio 2010, in April of 2010. 此版本中的重要新功能包括 POCO 支持、外键映射、延迟加载、可测试性改进、可自定义代码生成和 Model First 工作流。Important new features in this release included POCO support, foreign key mapping, lazy loading, testability improvements, customizable code generation and the Model First workflow.

尽管它是实体框架的第二个版本,但它被命名为 EF 4,以与其随附的 .NET Framework 版本保持一致。Although it was the second release of Entity Framework, it was named EF 4 to align with the .NET Framework version that it shipped with. 在此版本发布后,我们开始在 NuGet 上提供实体框架,并采纳语义版本控制,因为我们不再与 .NET Framework 版本关联。After this release, we started making Entity Framework available on NuGet and adopted semantic versioning since we were no longer tied to the .NET Framework Version.

请注意,某些后续版本的 .NET Framework 附带了包含 EF 位的重大更新。Note that some subsequent versions of .NET Framework have shipped with significant updates to the included EF bits. 事实上,EF 5.0 的许多新功能已实现为这些位的改进。In fact, many of the new features of EF 5.0 were implemented as improvements on these bits. 但是,为了合理化 EF 的版本控制情景,我们将继续引用作为 EF 4.0 运行时的一部分 .NET Framework 的 EF 位,而所有更新版本都包含 EntityFramework NuGet 包However, in order to rationalize the versioning story for EF, we continue to refer to the EF bits that are part of the .NET Framework as the EF 4.0 runtime, while all newer versions consist of the EntityFramework NuGet Package.

EF 3。5EF 3.5

实体框架的初始版本包含在3.5 年 8 2008 月发布的 .NET Service Pack 1 和 Visual Studio 2008 SP1 中。The initial version of Entity Framework was included in .NET 3.5 Service Pack 1 and Visual Studio 2008 SP1, released in August of 2008. 此版本提供了使用 Database First 工作流的基本 O/RM 支持。This release provided basic O/RM support using the Database First workflow.