ConventionEntityTypeExtensions.AddIndexerProperty Method

Definition

Adds a property backed by and indexer to this entity type.

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

Parameters

entityType
IConventionEntityType

The entity type.

name
String

The name of the property to add.

propertyType
Type

The type of value the property will hold.

setTypeConfigurationSource
Boolean

Indicates whether the type configuration source should be set.

fromDataAnnotation
Boolean

Indicates whether the configuration was specified using a data annotation.

Returns

The newly created property.

Applies to