protected override void OnModelCreating(ModelBuilder builder) { builder.Entity<User>() .HasIndex(u => u.Email) .IsUnique(); }
EF COre Unique Columns