Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

ef core unique index

protected override void OnModelCreating(ModelBuilder modelBuilder){    modelBuilder.Entity<Book>()        .HasIndex(b => b.Isbn)        .IsUnique();}
Source by www.learnentityframeworkcore.com #
 
PREVIOUS NEXT
Tagged: #ef #core #unique #index
ADD COMMENT
Topic
Name
9+2 =