ConventionEntityTypeExtensions.AddIndexerProperty 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
將 和 索引子所支援的屬性加入至這個實體類型。
public static Microsoft.EntityFrameworkCore.Metadata.IConventionProperty AddIndexerProperty (this Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType entityType, string name, Type propertyType, bool setTypeConfigurationSource = true, bool fromDataAnnotation = false);
static member AddIndexerProperty : Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType * string * Type * bool * bool -> Microsoft.EntityFrameworkCore.Metadata.IConventionProperty
<Extension()>
Public Function AddIndexerProperty (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
指出是否已使用資料批註指定組態。
傳回
新建立的屬性。