ConventionEntityTypeExtensions.AddProperty 方法

定義

多載

AddProperty(IConventionEntityType, MemberInfo, Boolean)

將屬性加入至這個實體類型。

AddProperty(IConventionEntityType, String, Boolean)

將屬性加入至這個實體類型。

AddProperty(IConventionEntityType, String, Type, Boolean, Boolean)

將屬性加入至這個實體類型。

AddProperty(IConventionEntityType, MemberInfo, Boolean)

將屬性加入至這個實體類型。

public static Microsoft.EntityFrameworkCore.Metadata.IConventionProperty AddProperty (this Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType entityType, System.Reflection.MemberInfo memberInfo, bool fromDataAnnotation = false);
static member AddProperty : Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType * System.Reflection.MemberInfo * bool -> Microsoft.EntityFrameworkCore.Metadata.IConventionProperty
<Extension()>
Public Function AddProperty (entityType As IConventionEntityType, memberInfo As MemberInfo, Optional fromDataAnnotation As Boolean = false) As IConventionProperty

參數

entityType
IConventionEntityType

實體類型。

memberInfo
MemberInfo

實體類別上的對應成員。

fromDataAnnotation
Boolean

指出是否已使用資料批註指定組態。

傳回

新建立的屬性。

適用於

AddProperty(IConventionEntityType, String, Boolean)

將屬性加入至這個實體類型。

public static Microsoft.EntityFrameworkCore.Metadata.IConventionProperty AddProperty (this Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType entityType, string name, bool fromDataAnnotation = false);
static member AddProperty : Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType * string * bool -> Microsoft.EntityFrameworkCore.Metadata.IConventionProperty
<Extension()>
Public Function AddProperty (entityType As IConventionEntityType, name As String, Optional fromDataAnnotation As Boolean = false) As IConventionProperty

參數

entityType
IConventionEntityType

實體類型。

name
String

要加入的屬性名稱。

fromDataAnnotation
Boolean

指出是否已使用資料批註指定組態。

傳回

新建立的屬性。

適用於

AddProperty(IConventionEntityType, String, Type, Boolean, Boolean)

將屬性加入至這個實體類型。

public static Microsoft.EntityFrameworkCore.Metadata.IConventionProperty AddProperty (this Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType entityType, string name, Type propertyType, bool setTypeConfigurationSource = true, bool fromDataAnnotation = false);
static member AddProperty : Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType * string * Type * bool * bool -> Microsoft.EntityFrameworkCore.Metadata.IConventionProperty
<Extension()>
Public Function AddProperty (entityType As IConventionEntityType, name As String, propertyType As Type, Optional setTypeConfigurationSource As Boolean = true, Optional fromDataAnnotation As Boolean = false) As IConventionProperty

參數

entityType
IConventionEntityType

實體類型。

name
String

要加入的屬性名稱。

propertyType
Type

屬性將保留的數值型別。

setTypeConfigurationSource
Boolean

指出是否應該設定類型組態來源。

fromDataAnnotation
Boolean

指出是否已使用資料批註指定組態。

傳回

新建立的屬性。

適用於