EF Core 1.1 中的新增功能New features in EF Core 1.1


字段映射Field mapping

允许配置属性的支持字段。Allows you to configure a backing field for a property. 这对于只读属性或具有 Get/Set 方法(而不是属性)的数据很有用。This can be useful for read-only properties, or data that has Get/Set methods rather than a property.

映射到 SQL Server 内存优化表Mapping to Memory-Optimized Tables in SQL Server

你可以指定实体映射到的表是内存优化表。You can specify that the table an entity is mapped to is memory-optimized. 使用 EF Core 创建和维护基于模型的数据库时(使用迁移或 Database.EnsureCreated()),将为这些实体创建内存优化表。When using EF Core to create and maintain a database based on your model (either with migrations or Database.EnsureCreated()), a memory-optimized table will be created for these entities.

更改跟踪Change tracking

来自 EF6 的其他更改跟踪 APIAdditional change tracking APIs from EF6

ReloadGetModifiedPropertiesGetDatabaseValues 等。Such as Reload, GetModifiedProperties, GetDatabaseValues etc.


显式加载Explicit Loading

允许在先前从数据库加载的实体上触发导航属性填充。Allows you to trigger population of a navigation property on an entity that was previously loaded from the database.


提供一种基于主键值提取实体的简单方法。Provides an easy way to fetch an entity based on its primary key value.


连接复原Connection resiliency

自动重试失败的数据库命令。Automatically retries failed database commands. 当连接到 SQL Azure 时(其中瞬间失败非常普遍)该操作非常有用。This is especially useful when connection to SQL Azure, where transient failures are common.

简化的服务替换Simplified service replacement

替换 EF 使用的内部服务更加简单。Makes it easier to replace internal services that EF uses.