TableBuilder.HasCheckConstraint(String, String) 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 a database check constraint when targeting a relational database.
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.CheckConstraintBuilder HasCheckConstraint (string name, string? sql);
abstract member HasCheckConstraint : string * string -> Microsoft.EntityFrameworkCore.Metadata.Builders.CheckConstraintBuilder
override this.HasCheckConstraint : string * string -> Microsoft.EntityFrameworkCore.Metadata.Builders.CheckConstraintBuilder
Public Overridable Function HasCheckConstraint (name As String, sql As String) As CheckConstraintBuilder
Parameters
- name
- String
The name of the check constraint.
- sql
- String
The logical constraint sql used in the check constraint.
Returns
A builder to configure the check constraint.
Remarks
See Database check constraints for more information and examples.
Applies to
Samarbeta med oss på GitHub
Källan för det här innehållet finns på GitHub, där du även kan skapa och granska ärenden och pull-begäranden. Se vår deltagarguide för mer information.
Entity Framework