When creating indexes with code first migrations in Entity Framework Core you can create an index on a table by adding the following to your DbContext:
protected override void OnModelCreating(ModelBuilder modelBuilder) { base.OnModelCreating(modelBuilder); modelBuilder.Entity<table>() .HasIndex(t => new { t.Column1, t.Column2}); }
Continue reading “Add Index with Include Entity Framework Core”