EntityMappingConfiguration<TEntityType> 类

定义

配置实体类型或实体类型中属性子集的表和列映射。 此配置功能通过 Code First Fluent API 提供,请参阅 DbModelBuilder

public class EntityMappingConfiguration<TEntityType> where TEntityType : class
type EntityMappingConfiguration<'EntityType (requires 'EntityType : null)> = class
Public Class EntityMappingConfiguration(Of TEntityType)

类型参数

TEntityType

要映射的实体类型。

继承
EntityMappingConfiguration<TEntityType>

构造函数

EntityMappingConfiguration<TEntityType>()

初始化 EntityMappingConfiguration<TEntityType> 类的新实例。

方法

Equals(Object)

配置实体类型或实体类型中属性子集的表和列映射。 此配置功能通过 Code First Fluent API 提供,请参阅 DbModelBuilder

GetHashCode()

配置实体类型或实体类型中属性子集的表和列映射。 此配置功能通过 Code First Fluent API 提供,请参阅 DbModelBuilder

GetType()

获取当前实例的 Type

HasTableAnnotation(String, Object)

在此实体映射到的表的模型中设置批注。 注释值稍后可以在处理表时使用,例如在创建迁移时。

MapInheritedProperties()

重新映射从基类型继承的所有属性。 将派生类型配置为映射到单独的表时,这将导致所有属性都包含在表中,而不仅仅是非继承的属性。 这称为“每个具体类型一个表”(TPC) 映射。

Properties<TObject>(Expression<Func<TEntityType,TObject>>)

配置将包含在此映射片段中的属性。 如果未调用此方法,则将配置尚未包含在映射片段中的所有属性。

Property(Expression<Func<TEntityType,Byte[]>>)

System.byte[]配置此映射片段中包含的属性。

Property(Expression<Func<TEntityType,DateTime>>)

DateTime配置此映射片段中包含的属性。

Property(Expression<Func<TEntityType,DateTimeOffset>>)

DateTimeOffset配置此映射片段中包含的属性。

Property(Expression<Func<TEntityType,DbGeography>>)

DbGeography配置此映射片段中包含的属性。

Property(Expression<Func<TEntityType,DbGeometry>>)

DbGeometry配置此映射片段中包含的属性。

Property(Expression<Func<TEntityType,Decimal>>)

System.decimal配置此映射片段中包含的属性。

Property(Expression<Func<TEntityType,Nullable<DateTime>>>)

System.DateTime?配置此映射片段中包含的属性。

Property(Expression<Func<TEntityType,Nullable<DateTimeOffset>>>)

System.DateTimeOffset?配置此映射片段中包含的属性。

Property(Expression<Func<TEntityType,Nullable<Decimal>>>)

System.decimal?配置此映射片段中包含的属性。

Property(Expression<Func<TEntityType,Nullable<TimeSpan>>>)

System.TimeSpan?配置此映射片段中包含的属性。

Property(Expression<Func<TEntityType,String>>)

System.string配置此映射片段中包含的属性。

Property(Expression<Func<TEntityType,TimeSpan>>)

TimeSpan配置此映射片段中包含的属性。

Property<T>(Expression<Func<TEntityType,Nullable<T>>>)

System.struct?配置此映射片段中包含的属性。

Property<T>(Expression<Func<TEntityType,T>>)

System.struct配置此映射片段中包含的属性。

Requires(String)

配置用于区分继承层次结构中的各个类型的鉴别器列。

Requires<TProperty>(Expression<Func<TEntityType,TProperty>>)

配置用于区分继承层次结构中各个类型的鉴别器条件。

ToString()

配置实体类型或实体类型中属性子集的表和列映射。 此配置功能通过 Code First Fluent API 提供,请参阅 DbModelBuilder

ToTable(String)

配置要映射到的表名。

ToTable(String, String)

配置要映射到的表名和架构。

适用于