RelationalIndexBuilderExtensions.HasFilter Method

Definition

Overloads

HasFilter(IndexBuilder, String)

Configures the filter expression for the index.

HasFilter(IConventionIndexBuilder, String, Boolean)

Configures the filter expression for the index.

HasFilter<TEntity>(IndexBuilder<TEntity>, String)

Configures the filter expression for the index.

HasFilter(IndexBuilder, String)

Configures the filter expression for the index.

public static Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder HasFilter (this Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder indexBuilder, string sql);
public static Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder HasFilter (this Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder indexBuilder, string? sql);
static member HasFilter : Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder * string -> Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder
<Extension()>
Public Function HasFilter (indexBuilder As IndexBuilder, sql As String) As IndexBuilder

Parameters

indexBuilder
IndexBuilder

The builder for the index being configured.

sql
String

The filter expression for the index.

Returns

A builder to further configure the index.

Remarks

See Indexes for more information and examples.

Applies to

HasFilter(IConventionIndexBuilder, String, Boolean)

Configures the filter expression for the index.

public static Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionIndexBuilder HasFilter (this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionIndexBuilder indexBuilder, string sql, bool fromDataAnnotation = false);
public static Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionIndexBuilder? HasFilter (this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionIndexBuilder indexBuilder, string? sql, bool fromDataAnnotation = false);
static member HasFilter : Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionIndexBuilder * string * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionIndexBuilder
<Extension()>
Public Function HasFilter (indexBuilder As IConventionIndexBuilder, sql As String, Optional fromDataAnnotation As Boolean = false) As IConventionIndexBuilder

Parameters

indexBuilder
IConventionIndexBuilder

The builder for the index being configured.

sql
String

The filter expression for the index.

fromDataAnnotation
Boolean

Indicates whether the configuration was specified using a data annotation.

Returns

The same builder instance if the configuration was applied, null otherwise.

Remarks

See Indexes for more information and examples.

Applies to

HasFilter<TEntity>(IndexBuilder<TEntity>, String)

Configures the filter expression for the index.

public static Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder<TEntity> HasFilter<TEntity> (this Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder<TEntity> indexBuilder, string sql);
public static Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder<TEntity> HasFilter<TEntity> (this Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder<TEntity> indexBuilder, string? sql);
static member HasFilter : Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder<'Entity> * string -> Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder<'Entity>
<Extension()>
Public Function HasFilter(Of TEntity) (indexBuilder As IndexBuilder(Of TEntity), sql As String) As IndexBuilder(Of TEntity)

Type Parameters

TEntity

The entity type being configured.

Parameters

indexBuilder
IndexBuilder<TEntity>

The builder for the index being configured.

sql
String

The filter expression for the index.

Returns

IndexBuilder<TEntity>

A builder to further configure the index.

Remarks

See Indexes for more information and examples.

Applies to