ReferenceCollectionBuilder.IsConstrained(Boolean) 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 (backed by a guarantee that a matching principal
key exists for every set foreign key value). 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 IsConstrained(bool constrained = true);
abstract member IsConstrained : bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.ReferenceCollectionBuilder
override this.IsConstrained : bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.ReferenceCollectionBuilder
Public Overridable Function IsConstrained (Optional constrained As Boolean = true) As ReferenceCollectionBuilder
Parameters
- constrained
- Boolean
A value indicating whether the relationship is constrained.
Returns
The same builder instance so that multiple configuration calls can be chained.