cara mengatur kendala unik dari EF Core

protected override void OnModelCreating(ModelBuilder builder)
{
    builder.Entity<User>()
        .HasIndex(u => u.Email)
        .IsUnique();
}
Red Necked Wallaby