Answers for "make a column unique in ef core"

0

how to set unique constraint from EF core

protected override void OnModelCreating(ModelBuilder builder)
{
    builder.Entity<User>()
        .HasIndex(u => u.Email)
        .IsUnique();
}
Posted by: Guest on February-27-2020
0

make a column unique in ef core

EF COre Unique Columns
Posted by: Guest on June-17-2021

Browse Popular Code Answers by Language