Idioma

ReferenceCollectionBuilder<TPrincipalEntity,TDependentEntity>.IsConstrained Method

Definition

Configures whether the relationship is constrained. When false, no database foreign key constraint is created and queries treat the relationship as optional (the principal is not assumed to exist), even when the foreign key properties are non-nullable. This does not affect change tracking. See IsConstrained.

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.ReferenceCollectionBuilder<TPrincipalEntity,TDependentEntity> IsConstrained(bool constrained = true);
override this.IsConstrained : bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.ReferenceCollectionBuilder<'PrincipalEntity, 'DependentEntity (requires 'PrincipalEntity : null and 'DependentEntity : null)>
Public Overridable Function IsConstrained (Optional constrained As Boolean = true) As ReferenceCollectionBuilder(Of TPrincipalEntity, TDependentEntity)

Parameters

constrained
Boolean

A value indicating whether the relationship is constrained.

Returns

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

Applies to