using Microsoft.EntityFrameworkCore; using Demka_Snova_1.Hardik.Conect.Dao; namespace Demka_Snova_1.Hardik.Conect; public class AppDbContext : DbContext { protected override void OnConfiguring(DbContextOptionsBuilder oB) { oB.UseSqlServer("Hoi"); } public DbSet sotrudnik { get; set; } public DbSet uslugi { get; set; } public DbSet orders { get; set; } public DbSet klient { get; set; } public DbSet history { get; set; } protected override void OnModelCreating(ModelBuilder mb) { mb.Entity().HasKey(klient => klient.Code); mb.Entity().Property(klient => klient.Code).ValueGeneratedOnAdd(); mb.Entity().HasKey(orders => orders.ID); mb.Entity().Property(orders => orders.ID).ValueGeneratedOnAdd(); mb.Entity().HasKey(uslugi => uslugi.ID); mb.Entity().HasKey(sotrudnik => sotrudnik.ID); mb.Entity().HasKey(history => history.id); } }