Class EnsureIndexOperation
Ensures an index (single-key or composite) exists.
public sealed class EnsureIndexOperation : MigrationOperation
- Inheritance
-
EnsureIndexOperation
- Inherited Members
Constructors
EnsureIndexOperation(Type, IReadOnlyList<IndexKey>)
Ensures an index (single-key or composite) exists.
public EnsureIndexOperation(Type entityType, IReadOnlyList<IndexKey> keys)
Parameters
entityTypeTypekeysIReadOnlyList<IndexKey>
Properties
ExpireAfter
When set, a TTL index expiring documents this long after the (single) key's date value.
public TimeSpan? ExpireAfter { get; init; }
Property Value
Filter
When set, a partial/filtered index: only rows matching this typed predicate are indexed.
public LambdaExpression? Filter { get; init; }
Property Value
Keys
The ordered index keys.
public IReadOnlyList<IndexKey> Keys { get; }
Property Value
Method
The index structure; providers reject methods they cannot build.
public IndexMethod Method { get; init; }
Property Value
Name
An explicit index name, or null to let the provider derive one.
public string? Name { get; init; }
Property Value
Unique
Whether the index enforces uniqueness.
public bool Unique { get; init; }