共用方式為


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)

設定要對應的目標資料表名稱和結構描述。

適用於