SqlServerModelBuilderExtensions.UseNamedDefaultConstraints 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.
Overloads
| Name | Description |
|---|---|
| UseNamedDefaultConstraints(ModelBuilder, Boolean) |
Configures the model to use named default constraints. |
| UseNamedDefaultConstraints(IConventionModelBuilder, Boolean, Boolean) |
Configures the model to use named default constraints. |
UseNamedDefaultConstraints(ModelBuilder, Boolean)
Configures the model to use named default constraints.
public static Microsoft.EntityFrameworkCore.ModelBuilder UseNamedDefaultConstraints(this Microsoft.EntityFrameworkCore.ModelBuilder modelBuilder, bool value = true);
static member UseNamedDefaultConstraints : Microsoft.EntityFrameworkCore.ModelBuilder * bool -> Microsoft.EntityFrameworkCore.ModelBuilder
<Extension()>
Public Function UseNamedDefaultConstraints (modelBuilder As ModelBuilder, Optional value As Boolean = true) As ModelBuilder
Parameters
- modelBuilder
- ModelBuilder
The model builder.
- value
- Boolean
The value to use.
Returns
The same builder instance so that multiple calls can be chained.
Remarks
See Modeling entity types and relationships, and Accessing SQL Server and Azure SQL databases with EF Core for more information and examples.
Applies to
UseNamedDefaultConstraints(IConventionModelBuilder, Boolean, Boolean)
Configures the model to use named default constraints.
public static Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionModelBuilder? UseNamedDefaultConstraints(this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionModelBuilder modelBuilder, bool value, bool fromDataAnnotation = false);
static member UseNamedDefaultConstraints : Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionModelBuilder * bool * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionModelBuilder
<Extension()>
Public Function UseNamedDefaultConstraints (modelBuilder As IConventionModelBuilder, value As Boolean, Optional fromDataAnnotation As Boolean = false) As IConventionModelBuilder
Parameters
- modelBuilder
- IConventionModelBuilder
The model builder.
- value
- Boolean
The value to use.
- fromDataAnnotation
- Boolean
Indicates whether the configuration was specified using a data annotation.
Returns
The same builder instance if the configuration was applied,
null otherwise.
Remarks
See Modeling entity types and relationships, and Accessing SQL Server and Azure SQL databases with EF Core for more information and examples.