Share via


RuntimeTypeBase.AddComplexProperty Method

Definition

Adds a complex property to this entity type.

public virtual Microsoft.EntityFrameworkCore.Metadata.RuntimeComplexProperty AddComplexProperty (string name, Type clrType, string targetTypeName, Type targetType, System.Reflection.PropertyInfo? propertyInfo = default, System.Reflection.FieldInfo? fieldInfo = default, Microsoft.EntityFrameworkCore.PropertyAccessMode propertyAccessMode = Microsoft.EntityFrameworkCore.PropertyAccessMode.PreferField, bool nullable = false, bool collection = false, Microsoft.EntityFrameworkCore.ChangeTrackingStrategy changeTrackingStrategy = Microsoft.EntityFrameworkCore.ChangeTrackingStrategy.Snapshot, System.Reflection.PropertyInfo? indexerPropertyInfo = default, bool propertyBag = false);
abstract member AddComplexProperty : string * Type * string * Type * System.Reflection.PropertyInfo * System.Reflection.FieldInfo * Microsoft.EntityFrameworkCore.PropertyAccessMode * bool * bool * Microsoft.EntityFrameworkCore.ChangeTrackingStrategy * System.Reflection.PropertyInfo * bool -> Microsoft.EntityFrameworkCore.Metadata.RuntimeComplexProperty
override this.AddComplexProperty : string * Type * string * Type * System.Reflection.PropertyInfo * System.Reflection.FieldInfo * Microsoft.EntityFrameworkCore.PropertyAccessMode * bool * bool * Microsoft.EntityFrameworkCore.ChangeTrackingStrategy * System.Reflection.PropertyInfo * bool -> Microsoft.EntityFrameworkCore.Metadata.RuntimeComplexProperty
Public Overridable Function AddComplexProperty (name As String, clrType As Type, targetTypeName As String, targetType As Type, Optional propertyInfo As PropertyInfo = Nothing, Optional fieldInfo As FieldInfo = Nothing, Optional propertyAccessMode As PropertyAccessMode = Microsoft.EntityFrameworkCore.PropertyAccessMode.PreferField, Optional nullable As Boolean = false, Optional collection As Boolean = false, Optional changeTrackingStrategy As ChangeTrackingStrategy = Microsoft.EntityFrameworkCore.ChangeTrackingStrategy.Snapshot, Optional indexerPropertyInfo As PropertyInfo = Nothing, Optional propertyBag As Boolean = false) As RuntimeComplexProperty

Parameters

name
String

The name of the property to add.

clrType
Type

The type of value the property will hold.

targetTypeName
String

The name of the complex type to be added.

targetType
Type

The CLR type that is used to represent instances of this complex type.

propertyInfo
PropertyInfo

The corresponding CLR property or null for a shadow property.

fieldInfo
FieldInfo

The corresponding CLR field or null for a shadow property.

propertyAccessMode
PropertyAccessMode

The PropertyAccessMode used for this property.

nullable
Boolean

A value indicating whether this property can contain null.

collection
Boolean

Indicates whether the property represents a collection.

changeTrackingStrategy
ChangeTrackingStrategy

The change tracking strategy for this complex type.

indexerPropertyInfo
PropertyInfo

The PropertyInfo for the indexer on the associated CLR type if one exists.

propertyBag
Boolean

A value indicating whether this entity type has an indexer which is able to contain arbitrary properties and a method that can be used to determine whether a given indexer property contains a value.

Returns

The newly created property.

Applies to