EfCore.Shaman icon indicating copy to clipboard operation
EfCore.Shaman copied to clipboard

Add support for configuring column Index to be Filtered

Open borisdj opened this issue 7 years ago • 0 comments

With FluenApi syntax is: modelBuilder.Entity<Company>().HasIndex(a => a.Email).IsUnique().HasFilter("[Deleted] = 0");

Now this can be new attribute [FilteredIndexAttribute(condition)] where condition is String type. Or to extend [IndexAttribute] and/or [UniqueIndexAttribute] with another constructor. Now is my case I need column Index to be at same time Unique and Filtered, but technically I guest it is possible even to be Filtered but not Unique, so taking that into the consideration, it should be implemented that both can be configured, either with 2 attributes or 2 parameters.

borisdj avatar Oct 13 '17 06:10 borisdj