Table of Contents

Interface IConventionComplexPropertyBuilder

Namespace
Microsoft.EntityFrameworkCore.Metadata.Builders
Assembly
Microsoft.EntityFrameworkCore.dll

Provides a simple API surface for configuring an IConventionComplexProperty from conventions.

This interface is typically used by database providers (and other extensions). It is generally not used in application code.

public interface IConventionComplexPropertyBuilder : IConventionPropertyBaseBuilder<IConventionComplexPropertyBuilder>, IConventionAnnotatableBuilder
Inherited Members

Remarks

See Model building conventions for more information and examples.

Properties

Metadata

Gets the property being configured.

IConventionComplexProperty Metadata { get; }

Property Value

IConventionComplexProperty

Methods

CanSetIsRequired(bool?, bool)

Returns a value indicating whether this property requiredness can be configured from the current configuration source.

bool CanSetIsRequired(bool? required, bool fromDataAnnotation = false)

Parameters

required bool?

A value indicating whether the property is required. null to reset to default.

fromDataAnnotation bool

Indicates whether the configuration was specified using a data annotation.

Returns

bool

true if the property requiredness can be configured.

IsRequired(bool?, bool)

Configures whether this property must have a value assigned or null is a valid value. A property can only be configured as non-required if it is based on a CLR type that can be assigned null.

IConventionComplexPropertyBuilder? IsRequired(bool? required, bool fromDataAnnotation = false)

Parameters

required bool?

A value indicating whether the property is required. null to reset to default.

fromDataAnnotation bool

Indicates whether the configuration was specified using a data annotation.

Returns

IConventionComplexPropertyBuilder

The same builder instance if the requiredness was configured, null otherwise.