Class CreateIndexOperation
- Namespace
- Microsoft.EntityFrameworkCore.Migrations.Operations
- Assembly
- Microsoft.EntityFrameworkCore.Relational.dll
A MigrationOperation for creating a new index.
public class CreateIndexOperation : MigrationOperation, ITableMigrationOperation
- Inheritance
-
CreateIndexOperation
- Implements
- Inherited Members
Remarks
See Database migrations for more information and examples.
Constructors
CreateIndexOperation()
public CreateIndexOperation()
Properties
Columns
The ordered list of column names for the column that make up the index.
public virtual string[] Columns { get; set; }
Property Value
- string[]
Filter
An expression to use as the index filter.
public virtual string? Filter { get; set; }
Property Value
IsDescending
A set of values indicating whether each corresponding index column has descending sort order.
public virtual bool[]? IsDescending { get; set; }
Property Value
- bool[]
IsUnique
Indicates whether or not the index should enforce uniqueness.
public virtual bool IsUnique { get; set; }
Property Value
Name
The name of the index.
public virtual string Name { get; set; }
Property Value
Schema
The schema that contains the index, or null if the default schema should be used.
public virtual string? Schema { get; set; }
Property Value
Table
The table that contains the index.
public virtual string Table { get; set; }
Property Value
Methods
CreateFrom(ITableIndex)
Creates a new CreateIndexOperation from the specified index.
public static CreateIndexOperation CreateFrom(ITableIndex index)
Parameters
index
ITableIndexThe index.
Returns
- CreateIndexOperation
The operation.