ReferenceCollectionBuilder<TPrincipalEntity,TDependentEntity>.IsConstrained Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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.