MutableEntityTypeExtensions.GetOrAddProperty 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
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
屬性是否處於陰影狀態。
傳回
現有或新建立的屬性。
備註
傳回的屬性可能沒有指定的類型和陰影性。
適用於
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應