EntityTypeBuilder<TEntity>.ComplexProperty Method

Definition

Overloads

ComplexProperty(String, Action<ComplexPropertyBuilder>)

Configures a complex property of the entity type. If no property with the given name exists, then a new property will be added.

ComplexProperty(Type, String, Action<ComplexPropertyBuilder>)

Returns an object that can be used to configure a complex property of the complex type. If no property with the given name exists, then a new property will be added.

ComplexProperty(Type, String, String, Action<ComplexPropertyBuilder>)

Returns an object that can be used to configure a complex property of the complex type. If no property with the given name exists, then a new property will be added.

ComplexProperty<TProperty>(String, String, Action<ComplexPropertyBuilder<TProperty>>)

Configures a complex property of the entity type. If no property with the given name exists, then a new property will be added.

ComplexProperty<TProperty>(Expression<Func<TEntity,TProperty>>, String, Action<ComplexPropertyBuilder<TProperty>>)

Configures a complex property of the entity type. If the specified property is not already part of the model, it will be added.

ComplexProperty<TProperty>(String, Action<ComplexPropertyBuilder<TProperty>>)

Configures a complex property of the entity type. If no property with the given name exists, then a new property will be added.

ComplexProperty<TProperty>(Expression<Func<TEntity,TProperty>>, Action<ComplexPropertyBuilder<TProperty>>)

Configures a complex property of the entity type. If the specified property is not already part of the model, it will be added.

ComplexProperty<TProperty>(Expression<Func<TEntity,TProperty>>)

Returns an object that can be used to configure a complex property of the entity type. If the specified property is not already part of the model, it will be added.

ComplexProperty<TProperty>(Expression<Func<TEntity,TProperty>>, String)

Returns an object that can be used to configure a complex property of the entity type. If the specified property is not already part of the model, it will be added.

ComplexProperty(String, Action<ComplexPropertyBuilder>)

Configures a complex property of the entity type. If no property with the given name exists, then a new property will be added.

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<TEntity> ComplexProperty (string propertyName, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder> buildAction);
override this.ComplexProperty : string * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder> -> Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<'Entity (requires 'Entity : null)>
Public Overridable Function ComplexProperty (propertyName As String, buildAction As Action(Of ComplexPropertyBuilder)) As EntityTypeBuilder(Of TEntity)

Parameters

propertyName
String

The name of the property to be configured.

buildAction
Action<ComplexPropertyBuilder>

An action that performs configuration of the property.

Returns

The same builder instance so that multiple configuration calls can be chained.

Remarks

When adding a new property with this overload the property name must match the name of a CLR property or field on the complex type. This overload cannot be used to add a new shadow state complex property.

Applies to

ComplexProperty(Type, String, Action<ComplexPropertyBuilder>)

Returns an object that can be used to configure a complex property of the complex type. If no property with the given name exists, then a new property will be added.

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<TEntity> ComplexProperty (Type propertyType, string propertyName, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder> buildAction);
override this.ComplexProperty : Type * string * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder> -> Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<'Entity (requires 'Entity : null)>
Public Overridable Function ComplexProperty (propertyType As Type, propertyName As String, buildAction As Action(Of ComplexPropertyBuilder)) As EntityTypeBuilder(Of TEntity)

Parameters

propertyType
Type

The type of the property to be configured.

propertyName
String

The name of the property to be configured.

buildAction
Action<ComplexPropertyBuilder>

An action that performs configuration of the property.

Returns

The same builder instance so that multiple configuration calls can be chained.

Remarks

When adding a new complex property, if a property with the same name exists in the complex class then it will be added to the model. If no property exists in the complex class, then a new shadow state complex property will be added. A shadow state property is one that does not have a corresponding property in the complex class. The current value for the property is stored in the ChangeTracker rather than being stored in instances of the complex class.

Applies to

ComplexProperty(Type, String, String, Action<ComplexPropertyBuilder>)

Returns an object that can be used to configure a complex property of the complex type. If no property with the given name exists, then a new property will be added.

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<TEntity> ComplexProperty (Type propertyType, string propertyName, string complexTypeName, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder> buildAction);
override this.ComplexProperty : Type * string * string * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder> -> Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<'Entity (requires 'Entity : null)>
Public Overridable Function ComplexProperty (propertyType As Type, propertyName As String, complexTypeName As String, buildAction As Action(Of ComplexPropertyBuilder)) As EntityTypeBuilder(Of TEntity)

Parameters

propertyType
Type

The type of the property to be configured.

propertyName
String

The name of the property to be configured.

complexTypeName
String

The name of the complex type.

buildAction
Action<ComplexPropertyBuilder>

An action that performs configuration of the property.

Returns

The same builder instance so that multiple configuration calls can be chained.

Remarks

When adding a new complex property, if a property with the same name exists in the complex class then it will be added to the model. If no property exists in the complex class, then a new shadow state complex property will be added. A shadow state property is one that does not have a corresponding property in the complex class. The current value for the property is stored in the ChangeTracker rather than being stored in instances of the complex class.

Applies to

ComplexProperty<TProperty>(String, String, Action<ComplexPropertyBuilder<TProperty>>)

Configures a complex property of the entity type. If no property with the given name exists, then a new property will be added.

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<TEntity> ComplexProperty<TProperty> (string propertyName, string complexTypeName, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<TProperty>> buildAction);
override this.ComplexProperty : string * string * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<'Property>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<'Entity (requires 'Entity : null)>
Public Overridable Function ComplexProperty(Of TProperty) (propertyName As String, complexTypeName As String, buildAction As Action(Of ComplexPropertyBuilder(Of TProperty))) As EntityTypeBuilder(Of TEntity)

Type Parameters

TProperty

The type of the property to be configured.

Parameters

propertyName
String

The name of the property to be configured.

complexTypeName
String

The name of the complex type.

buildAction
Action<ComplexPropertyBuilder<TProperty>>

An action that performs configuration of the property.

Returns

The same builder instance so that multiple configuration calls can be chained.

Remarks

When adding a new property, if a property with the same name exists in the complex class then it will be added to the model. If no property exists in the complex class, then a new shadow state complex property will be added. A shadow state property is one that does not have a corresponding property in the complex class. The current value for the property is stored in the ChangeTracker rather than being stored in instances of the complex class.

Applies to

ComplexProperty<TProperty>(Expression<Func<TEntity,TProperty>>, String, Action<ComplexPropertyBuilder<TProperty>>)

Configures a complex property of the entity type. If the specified property is not already part of the model, it will be added.

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<TEntity> ComplexProperty<TProperty> (System.Linq.Expressions.Expression<Func<TEntity,TProperty>> propertyExpression, string complexTypeName, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<TProperty>> buildAction);
override this.ComplexProperty : System.Linq.Expressions.Expression<Func<'Entity, 'Property>> * string * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<'Property>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<'Entity (requires 'Entity : null)>
Public Overridable Function ComplexProperty(Of TProperty) (propertyExpression As Expression(Of Func(Of TEntity, TProperty)), complexTypeName As String, buildAction As Action(Of ComplexPropertyBuilder(Of TProperty))) As EntityTypeBuilder(Of TEntity)

Type Parameters

TProperty

Parameters

propertyExpression
Expression<Func<TEntity,TProperty>>

A lambda expression representing the property to be configured ( blog => blog.Url).

complexTypeName
String

The name of the complex type.

buildAction
Action<ComplexPropertyBuilder<TProperty>>

An action that performs configuration of the property.

Returns

The same builder instance so that multiple configuration calls can be chained.

Applies to

ComplexProperty<TProperty>(String, Action<ComplexPropertyBuilder<TProperty>>)

Configures a complex property of the entity type. If no property with the given name exists, then a new property will be added.

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<TEntity> ComplexProperty<TProperty> (string propertyName, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<TProperty>> buildAction);
override this.ComplexProperty : string * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<'Property>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<'Entity (requires 'Entity : null)>
Public Overridable Function ComplexProperty(Of TProperty) (propertyName As String, buildAction As Action(Of ComplexPropertyBuilder(Of TProperty))) As EntityTypeBuilder(Of TEntity)

Type Parameters

TProperty

The type of the property to be configured.

Parameters

propertyName
String

The name of the property to be configured.

buildAction
Action<ComplexPropertyBuilder<TProperty>>

An action that performs configuration of the property.

Returns

The same builder instance so that multiple configuration calls can be chained.

Remarks

When adding a new property, if a property with the same name exists in the complex class then it will be added to the model. If no property exists in the complex class, then a new shadow state complex property will be added. A shadow state property is one that does not have a corresponding property in the complex class. The current value for the property is stored in the ChangeTracker rather than being stored in instances of the complex class.

Applies to

ComplexProperty<TProperty>(Expression<Func<TEntity,TProperty>>, Action<ComplexPropertyBuilder<TProperty>>)

Configures a complex property of the entity type. If the specified property is not already part of the model, it will be added.

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<TEntity> ComplexProperty<TProperty> (System.Linq.Expressions.Expression<Func<TEntity,TProperty>> propertyExpression, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<TProperty>> buildAction);
override this.ComplexProperty : System.Linq.Expressions.Expression<Func<'Entity, 'Property>> * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<'Property>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<'Entity (requires 'Entity : null)>
Public Overridable Function ComplexProperty(Of TProperty) (propertyExpression As Expression(Of Func(Of TEntity, TProperty)), buildAction As Action(Of ComplexPropertyBuilder(Of TProperty))) As EntityTypeBuilder(Of TEntity)

Type Parameters

TProperty

Parameters

propertyExpression
Expression<Func<TEntity,TProperty>>

A lambda expression representing the property to be configured ( blog => blog.Url).

buildAction
Action<ComplexPropertyBuilder<TProperty>>

An action that performs configuration of the property.

Returns

The same builder instance so that multiple configuration calls can be chained.

Applies to

ComplexProperty<TProperty>(Expression<Func<TEntity,TProperty>>)

Returns an object that can be used to configure a complex property of the entity type. If the specified property is not already part of the model, it will be added.

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<TProperty> ComplexProperty<TProperty> (System.Linq.Expressions.Expression<Func<TEntity,TProperty>> propertyExpression);
override this.ComplexProperty : System.Linq.Expressions.Expression<Func<'Entity, 'Property>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<'Property>
Public Overridable Function ComplexProperty(Of TProperty) (propertyExpression As Expression(Of Func(Of TEntity, TProperty))) As ComplexPropertyBuilder(Of TProperty)

Type Parameters

TProperty

Parameters

propertyExpression
Expression<Func<TEntity,TProperty>>

A lambda expression representing the property to be configured ( blog => blog.Url).

Returns

An object that can be used to configure the complex property.

Applies to

ComplexProperty<TProperty>(Expression<Func<TEntity,TProperty>>, String)

Returns an object that can be used to configure a complex property of the entity type. If the specified property is not already part of the model, it will be added.

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<TProperty> ComplexProperty<TProperty> (System.Linq.Expressions.Expression<Func<TEntity,TProperty>> propertyExpression, string complexTypeName);
override this.ComplexProperty : System.Linq.Expressions.Expression<Func<'Entity, 'Property>> * string -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<'Property>
Public Overridable Function ComplexProperty(Of TProperty) (propertyExpression As Expression(Of Func(Of TEntity, TProperty)), complexTypeName As String) As ComplexPropertyBuilder(Of TProperty)

Type Parameters

TProperty

Parameters

propertyExpression
Expression<Func<TEntity,TProperty>>

A lambda expression representing the property to be configured ( blog => blog.Url).

complexTypeName
String

The name of the complex type.

Returns

An object that can be used to configure the complex property.

Applies to