Class AddCheckConstraintOperation
- Namespace
- Microsoft.EntityFrameworkCore.Migrations.Operations
- Assembly
- Microsoft.EntityFrameworkCore.Relational.dll
A MigrationOperation for creating a new check constraint.
public class AddCheckConstraintOperation : MigrationOperation, ITableMigrationOperation
- Inheritance
-
AddCheckConstraintOperation
- Implements
- Inherited Members
Constructors
AddCheckConstraintOperation()
public AddCheckConstraintOperation()
Properties
Name
The name of the check constraint.
public virtual string Name { get; set; }
Property Value
Schema
The table schema that contains the check constraint, or null if the default schema should be used.
public virtual string Schema { get; set; }
Property Value
Sql
The logical sql expression used in a CHECK constraint and returns TRUE or FALSE. SQL used with CHECK constraints cannot reference another table but can reference other columns in the same table for the same row. The expression cannot reference an alias data type.
public virtual string Sql { get; set; }
Property Value
Table
The table of the check constraint.
public virtual string Table { get; set; }
Property Value
Methods
CreateFrom(ICheckConstraint)
Creates a new AddCheckConstraintOperation from the specified check constraint.
public static AddCheckConstraintOperation CreateFrom(ICheckConstraint checkConstraint)
Parameters
checkConstraint
ICheckConstraintThe check constraint.
Returns
- AddCheckConstraintOperation
The operation.