Skip to content

Migrations: SQL Server Filtered Indexes #5817

@MarcoLoetscher

Description

@MarcoLoetscher

For indexes on SQL Server, it should be possible to set a filter might as string or lamda expression:
modelBuilder.Entity<Blog>().HasIndex(b => b.Url, "[Url] IS NOT NULL AND [IsActive] = 1");
or
modelBuilder.Entity<Blog>().HasIndex(b => b.Url, b => b.Url != null && b.IsActive == 1);

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueThis issue should be relatively straightforward to fix.help wantedThis issue involves technologies where we are not experts. Expert help would be appreciated.
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions