diff --git a/Hardik/Conect/Conector.cs b/Hardik/Conect/Conector.cs index e65c7f0..c6c8711 100644 --- a/Hardik/Conect/Conector.cs +++ b/Hardik/Conect/Conector.cs @@ -4,10 +4,26 @@ namespace Demka_Snova_1.Hardik.Conect; public class AppDbContext : DbContext { - public DbSet sotrudnik { get; set; } - protected override void OnConfiguring(DbContextOptionsBuilder oB) { - oB.UseSqlServer("Hoi"); + oB.UseSqlServer("Host=45.67.56.214;Port=5421;Username=user16;Password=dZ28IVE5;Database=user16"); } + public DbSet sotrudnik { get; set; } + public DbSet uslugi { get; set; } + public DbSet orders { get; set; } + public DbSet klient { 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); + } + } \ No newline at end of file diff --git a/MainWindow.axaml b/MainWindow.axaml index 799ae6c..d9e487d 100644 --- a/MainWindow.axaml +++ b/MainWindow.axaml @@ -11,8 +11,8 @@ -