Interface IIndexOptions<TEntity>
Fluent options for a single-key index — providers reject the ones they cannot build, with guidance.
public interface IIndexOptions<TEntity> where TEntity : class
Type Parameters
TEntityThe entity type.
Methods
Descending()
Orders the key descending.
IIndexOptions<TEntity> Descending()
Returns
- IIndexOptions<TEntity>
Filtered(Expression<Func<TEntity, bool>>)
Makes the index partial/filtered: only rows matching the typed predicate are indexed
(PostgreSQL/SQL Server WHERE, MongoDB partial filter). The predicate goes through the same
interpretation as query filters.
IIndexOptions<TEntity> Filtered(Expression<Func<TEntity, bool>> predicate)
Parameters
predicateExpression<Func<TEntity, bool>>The typed row predicate.
Returns
- IIndexOptions<TEntity>
Gin()
Builds a PostgreSQL GIN index — what makes jsonb and array predicates fast.
IIndexOptions<TEntity> Gin()
Returns
- IIndexOptions<TEntity>
Named(string)
Gives the index an explicit name.
IIndexOptions<TEntity> Named(string name)
Parameters
namestringThe index name.
Returns
- IIndexOptions<TEntity>
Text()
Builds a text-search index (MongoDB text).
IIndexOptions<TEntity> Text()
Returns
- IIndexOptions<TEntity>
Ttl(TimeSpan)
Makes the index a TTL index: documents expire this long after the key's date value (MongoDB).
IIndexOptions<TEntity> Ttl(TimeSpan expireAfter)
Parameters
expireAfterTimeSpanThe time to live.
Returns
- IIndexOptions<TEntity>
Unique()
Makes the index enforce uniqueness.
IIndexOptions<TEntity> Unique()
Returns
- IIndexOptions<TEntity>