I have following base class
[Index(nameof(FullName), IsUnique = true)]
public abstract class Entity
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; set; }
public string FullName { get; set; } = null!;
}
and another class that inherits it
[Index(nameof(FullName), IsUnique = false)]
public class Citizen : Entity
{
}
So, I am trying to override IsUnique, but Entity Framework Core is creating Citizen table with Unique index in SQL Server database.
How to override or disable IsUnique on inherited class (without using model builder)?