IConventionTypeBase.AddProperty 方法

定義

多載

AddProperty(String, Type, Boolean, Boolean)

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

AddProperty(String, Type, MemberInfo, Boolean, Boolean)

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

AddProperty(MemberInfo, Boolean)

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

AddProperty(String, Boolean)

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

AddProperty(String, Type, Boolean, Boolean)

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

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

參數

name
String

要加入的屬性名稱。

propertyType
Type

屬性將保留的數值型別。

setTypeConfigurationSource
Boolean

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

fromDataAnnotation
Boolean

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

傳回

新建立的屬性。

適用於

AddProperty(String, Type, MemberInfo, Boolean, Boolean)

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

public Microsoft.EntityFrameworkCore.Metadata.IConventionProperty? AddProperty (string name, Type propertyType, System.Reflection.MemberInfo memberInfo, bool setTypeConfigurationSource = true, bool fromDataAnnotation = false);
abstract member AddProperty : string * Type * System.Reflection.MemberInfo * bool * bool -> Microsoft.EntityFrameworkCore.Metadata.IConventionProperty
Public Function AddProperty (name As String, propertyType As Type, memberInfo As MemberInfo, Optional setTypeConfigurationSource As Boolean = true, Optional fromDataAnnotation As Boolean = false) As IConventionProperty

參數

name
String

要加入的屬性名稱。

propertyType
Type

屬性將保留的數值型別。

memberInfo
MemberInfo

對應的 CLR 類型成員。

可以使用具有 String 參數和 Object 傳回類型的索引子。

setTypeConfigurationSource
Boolean

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

fromDataAnnotation
Boolean

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

傳回

新建立的屬性。

適用於

AddProperty(MemberInfo, Boolean)

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

[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Currently used only in tests")]
public virtual Microsoft.EntityFrameworkCore.Metadata.IConventionProperty? AddProperty (System.Reflection.MemberInfo memberInfo, bool fromDataAnnotation = false);
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Currently used only in tests")>]
abstract member AddProperty : System.Reflection.MemberInfo * bool -> Microsoft.EntityFrameworkCore.Metadata.IConventionProperty
override this.AddProperty : System.Reflection.MemberInfo * bool -> Microsoft.EntityFrameworkCore.Metadata.IConventionProperty
Public Overridable Function AddProperty (memberInfo As MemberInfo, Optional fromDataAnnotation As Boolean = false) As IConventionProperty

參數

memberInfo
MemberInfo

實體類別上的對應成員。

fromDataAnnotation
Boolean

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

傳回

新建立的屬性。

屬性

適用於

AddProperty(String, Boolean)

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

public Microsoft.EntityFrameworkCore.Metadata.IConventionProperty? AddProperty (string name, bool fromDataAnnotation = false);
abstract member AddProperty : string * bool -> Microsoft.EntityFrameworkCore.Metadata.IConventionProperty
Public Function AddProperty (name As String, Optional fromDataAnnotation As Boolean = false) As IConventionProperty

參數

name
String

要加入的屬性名稱。

fromDataAnnotation
Boolean

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

傳回

新建立的屬性。

適用於