MutableEntityTypeExtensions.GetOrAddProperty 方法

定義

多載

GetOrAddProperty(IMutableEntityType, PropertyInfo)

取得具有指定名稱的屬性,如果尚未定義,則建立新的屬性。

GetOrAddProperty(IMutableEntityType, String, Type)

取得具有指定名稱的屬性,如果尚未定義,則建立新的屬性。

GetOrAddProperty(IMutableEntityType, String, Type, Boolean)

取得具有指定名稱的屬性,如果尚未定義,則建立新的屬性。

GetOrAddProperty(IMutableEntityType, PropertyInfo)

取得具有指定名稱的屬性,如果尚未定義,則建立新的屬性。

public static Microsoft.EntityFrameworkCore.Metadata.IMutableProperty GetOrAddProperty (this Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType entityType, System.Reflection.PropertyInfo propertyInfo);
static member GetOrAddProperty : Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType * System.Reflection.PropertyInfo -> Microsoft.EntityFrameworkCore.Metadata.IMutableProperty
<Extension()>
Public Function GetOrAddProperty (entityType As IMutableEntityType, propertyInfo As PropertyInfo) As IMutableProperty

參數

entityType
IMutableEntityType

要取得或加入屬性的實體類型。

propertyInfo
PropertyInfo

實體類別中的對應屬性。

傳回

現有或新建立的屬性。

備註

傳回的屬性可能沒有指定的型別。

適用於

GetOrAddProperty(IMutableEntityType, String, Type)

取得具有指定名稱的屬性,如果尚未定義,則建立新的屬性。

public static Microsoft.EntityFrameworkCore.Metadata.IMutableProperty GetOrAddProperty (this Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType entityType, string name, Type propertyType);
static member GetOrAddProperty : Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType * string * Type -> Microsoft.EntityFrameworkCore.Metadata.IMutableProperty
<Extension()>
Public Function GetOrAddProperty (entityType As IMutableEntityType, name As String, propertyType As Type) As IMutableProperty

參數

entityType
IMutableEntityType

要取得或加入屬性的實體類型。

name
String

屬性的名稱。

propertyType
Type

屬性將保留的數值型別。

傳回

現有或新建立的屬性。

備註

傳回的屬性可能沒有指定的型別。

適用於

GetOrAddProperty(IMutableEntityType, String, Type, Boolean)

取得具有指定名稱的屬性,如果尚未定義,則建立新的屬性。

public static Microsoft.EntityFrameworkCore.Metadata.IMutableProperty GetOrAddProperty (this Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType entityType, string name, Type propertyType, bool shadow);
static member GetOrAddProperty : Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType * string * Type * bool -> Microsoft.EntityFrameworkCore.Metadata.IMutableProperty
<Extension()>
Public Function GetOrAddProperty (entityType As IMutableEntityType, name As String, propertyType As Type, shadow As Boolean) As IMutableProperty

參數

entityType
IMutableEntityType

要取得或加入屬性的實體類型。

name
String

屬性的名稱。

propertyType
Type

屬性將保留的數值型別。

shadow
Boolean

屬性是否處於陰影狀態。

傳回

現有或新建立的屬性。

備註

傳回的屬性可能沒有指定的類型和陰影性。

適用於