CreateCheckConstraintOperation Class

Definition

A MigrationOperation for creating a new check constraint.

public class CreateCheckConstraintOperation : Microsoft.EntityFrameworkCore.Migrations.Operations.MigrationOperation
[System.Diagnostics.DebuggerDisplay("ALTER TABLE {Table} ADD CONSTRAINT {Name} CHECK")]
public class CreateCheckConstraintOperation : Microsoft.EntityFrameworkCore.Migrations.Operations.MigrationOperation
type CreateCheckConstraintOperation = class
    inherit MigrationOperation
[<System.Diagnostics.DebuggerDisplay("ALTER TABLE {Table} ADD CONSTRAINT {Name} CHECK")>]
type CreateCheckConstraintOperation = class
    inherit MigrationOperation
Public Class CreateCheckConstraintOperation
Inherits MigrationOperation
Inheritance
CreateCheckConstraintOperation
Attributes

Constructors

CreateCheckConstraintOperation()

Properties

IsDestructiveChange

Indicates whether or not the operation might result in loss of data in the database.

(Inherited from MigrationOperation)
Item[String]

Gets the value annotation with the given name, returning null if it does not exist.

(Inherited from Annotatable)
Name

The name of the check constraint.

Schema

The table schema that contains the check constraint, or null if the default schema should be used.

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.

Table

The table of the check constraint.

Methods

AddAnnotation(String, Annotation)

Adds an annotation to this object. Throws if an annotation with the specified name already exists.

(Inherited from Annotatable)
AddAnnotation(String, Object)

Adds an annotation to this object. Throws if an annotation with the specified name already exists.

(Inherited from Annotatable)
CreateAnnotation(String, Object)

Creates a new annotation.

(Inherited from Annotatable)
EnsureMutable()

Throws if the model is read-only.

(Inherited from Annotatable)
EnsureReadOnly()

Throws if the model is not read-only.

(Inherited from Annotatable)
FindAnnotation(String)

Gets the annotation with the given name, returning null if it does not exist.

(Inherited from Annotatable)
GetAnnotations()

Gets all annotations on the current object.

(Inherited from Annotatable)
GetOrAddAnnotation(String, Object)

Adds an annotation to this object or returns the existing annotation if one with the specified name already exists.

(Inherited from Annotatable)
OnAnnotationSet(String, Annotation, Annotation)

Called when an annotation was set or removed.

(Inherited from Annotatable)
RemoveAnnotation(String)

Removes the given annotation from this object.

(Inherited from Annotatable)
SetAnnotation(String, Annotation)

Sets the annotation stored under the given key. Overwrites the existing annotation if an annotation with the specified name already exists.

(Inherited from Annotatable)
SetAnnotation(String, Annotation, Annotation)

Sets the annotation stored under the given key. Overwrites the existing annotation if an annotation with the specified name already exists.

(Inherited from Annotatable)
SetAnnotation(String, Object)

Sets the annotation stored under the given key. Overwrites the existing annotation if an annotation with the specified name already exists.

(Inherited from Annotatable)

Explicit Interface Implementations

IAnnotatable.FindAnnotation(String)

Gets the annotation with the given name, returning null if it does not exist.

(Inherited from Annotatable)
IAnnotatable.GetAnnotations()

Gets all annotations on the current object.

(Inherited from Annotatable)
IMutableAnnotatable.AddAnnotation(String, Object)

Adds an annotation to this object. Throws if an annotation with the specified name already exists.

(Inherited from Annotatable)
IMutableAnnotatable.RemoveAnnotation(String)

Removes the given annotation from this object.

(Inherited from Annotatable)

Extension Methods

GetAnnotation(IAnnotatable, String)

Gets the annotation with the given name, throwing if it does not exist.

AddAnnotations(IMutableAnnotatable, IEnumerable<IAnnotation>)

Adds annotations to an object.

GetAnnotation(IMutableAnnotatable, String)

Gets the annotation with the given name, throwing if it does not exist.

SetOrRemoveAnnotation(IMutableAnnotatable, String, Object)

Sets the annotation stored under the given name. Overwrites the existing annotation if an annotation with the specified name already exists. Removes the existing annotation if null is supplied.

Applies to