EfCore.Shaman
EfCore.Shaman copied to clipboard
Add support for configuring column Index to be Filtered
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.