Class AddPrimaryKeyOperation
- Namespace
- Microsoft.EntityFrameworkCore.Migrations.Operations
- Assembly
- Microsoft.EntityFrameworkCore.Relational.dll
A MigrationOperation to add a new foreign key.
public class AddPrimaryKeyOperation : MigrationOperation, ITableMigrationOperation
- Inheritance
-
AddPrimaryKeyOperation
- Implements
- Inherited Members
Constructors
AddPrimaryKeyOperation()
public AddPrimaryKeyOperation()
Properties
Columns
The ordered-list of column names for the columns that make up the primary key.
public virtual string[] Columns { get; set; }
Property Value
- string[]
Name
The name of the foreign key 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 key should be added.
public virtual string Table { get; set; }
Property Value
Methods
CreateFrom(IPrimaryKeyConstraint)
Creates a new AddPrimaryKeyOperation from the specified primary key.
public static AddPrimaryKeyOperation CreateFrom(IPrimaryKeyConstraint primaryKey)
Parameters
primaryKey
IPrimaryKeyConstraintThe primary key.
Returns
- AddPrimaryKeyOperation
The operation.