using Distribution.Models; using Microsoft.EntityFrameworkCore; namespace Distribution.Data; public class AppDBContext(DbContextOptions options) : DbContext(options) { public DbSet Regions { get; set; } public DbSet Routes { get; set; } public DbSet Vehicles { get; set; } public DbSet Stores { get; set; } public DbSet Warehouses { get; set; } public DbSet SaleRoutes { get; set; } public DbSet Orders { get; set; } public DbSet OrderItems { get; set; } public DbSet DeliveryRuns { get; set; } public DbSet Items { get; set; } protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder.Entity() .HasKey(oi => new { oi.FK_OrderId, oi.FK_ItemId }); } }