Class AddUniqueConstraintOperation
- Namespace
- Microsoft.EntityFrameworkCore.Migrations.Operations
- Assembly
- Microsoft.EntityFrameworkCore.Relational.dll
A MigrationOperation to add a new unique constraint.
public class AddUniqueConstraintOperation : MigrationOperation, ITableMigrationOperation
- Inheritance
-
AddUniqueConstraintOperation
- Implements
- Inherited Members
Constructors
AddUniqueConstraintOperation()
public AddUniqueConstraintOperation()
Properties
Columns
The ordered-list of column names for the columns that make up the constraint.
public virtual string[] Columns { get; set; }
Property Value
- string[]
Name
The name of the constraint.
public virtual string Name { get; set; }
Property Value
Schema
The schema that contains the table, or null if the default schema should be used.
public virtual string Schema { get; set; }
Property Value
Table
The table to which the constraint should be added.
public virtual string Table { get; set; }
Property Value
Methods
CreateFrom(IUniqueConstraint)
Creates a new AddUniqueConstraintOperation from the specified unique constraint.
public static AddUniqueConstraintOperation CreateFrom(IUniqueConstraint uniqueConstraint)
Parameters
uniqueConstraint
IUniqueConstraintThe unique constraint.
Returns
- AddUniqueConstraintOperation
The operation.