Closed as not planned
Description
Hello,
I cannot find anyway a solution for the following behaviour (maybe is by design, but I cannot figure out if it is): i've setup a query filter to provide global soft delete to my context, but it seems to be ignored by the unique check. Can anyone give me ad advice if there is a solution to achieve this? Right now I'm getting an exception in case of deleted records.
foreach (var type in modelBuilder.Model.GetEntityTypes())
{
if (type.ClrType.BaseType == typeof(Models.Entities.EFExtensions.BaseEntity))
{
modelBuilder.SetSoftDeleteFilter(type.ClrType);
}
}
modelBuilder.Entity<MyClass>().HasIndex(p => p.Name).IsUnique();
EF Core version: 5.0.1
Database provider: Microsoft.EntityFrameworkCore.SqLite
Target framework: .NET 5.0
Operating system: Linux/MacOs/Windows
IDE: Visual Studio Code