IConventionEntityTypeBuilder.IndexerProperty(Type, String, Boolean) 方法

定義

傳回物件,這個物件可用來設定具有指定名稱的索引子屬性。 如果沒有相符的屬性存在,則會加入新的屬性。

public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder? IndexerProperty (Type propertyType, string propertyName, bool fromDataAnnotation = false);
abstract member IndexerProperty : Type * string * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder
Public Function IndexerProperty (propertyType As Type, propertyName As String, Optional fromDataAnnotation As Boolean = false) As IConventionPropertyBuilder

參數

propertyType
Type

屬性將保留的數值型別。

propertyName
String

要設定的屬性名稱。

fromDataAnnotation
Boolean

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

傳回

如果屬性存在於實體類型上,則可用來設定屬性的物件, null 否則為 。

適用於