using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata; namespace MAX.Models { public class MAXContext : DbContext { public MAXContext(DbContextOptions options) : base(options) { } protected override void OnModelCreating(ModelBuilder modelBuilder) { base.OnModelCreating(modelBuilder); modelBuilder.Entity() .HasIndex(b => new { b.ReadyForDownload, b.OrderDate }); modelBuilder.Entity() .HasIndex(v => new { v.BatchId, v.SequenceNumber }) .IsUnique(); } public DbSet Accounts { get; set; } public DbSet Batches { get; set; } public DbSet Users { get; set; } public DbSet Vendors { get; set; } public DbSet Vouchers { get; set; } public DbSet Warehouses { get; set; } } }