diff --git a/BlacksmithWorkshop/BlacksmithWorkshopDatebaseImplement/Migrations/BlacksmithWorkshopDatabaseModelSnapshot.cs b/BlacksmithWorkshop/BlacksmithWorkshopDatebaseImplement/Migrations/BlacksmithWorkshopDatabaseModelSnapshot.cs index 4ad43c1..c723cca 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopDatebaseImplement/Migrations/BlacksmithWorkshopDatabaseModelSnapshot.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopDatebaseImplement/Migrations/BlacksmithWorkshopDatabaseModelSnapshot.cs @@ -44,7 +44,7 @@ namespace BlacksmithWorkshopDatebaseImplement.Migrations b.HasKey("Id"); - b.ToTable("Clients"); + b.ToTable("Clients", (string)null); }); modelBuilder.Entity("BlacksmithWorkshopDatabaseImplement.Models.Component", b => @@ -64,7 +64,7 @@ namespace BlacksmithWorkshopDatebaseImplement.Migrations b.HasKey("Id"); - b.ToTable("Components"); + b.ToTable("Components", (string)null); }); modelBuilder.Entity("BlacksmithWorkshopDatabaseImplement.Models.Manufacture", b => @@ -84,7 +84,7 @@ namespace BlacksmithWorkshopDatebaseImplement.Migrations b.HasKey("Id"); - b.ToTable("Manufactures"); + b.ToTable("Manufactures", (string)null); }); modelBuilder.Entity("BlacksmithWorkshopDatabaseImplement.Models.ManufactureComponent", b => @@ -110,7 +110,7 @@ namespace BlacksmithWorkshopDatebaseImplement.Migrations b.HasIndex("ManufactureId"); - b.ToTable("ManufactureComponents"); + b.ToTable("ManufactureComponents", (string)null); }); modelBuilder.Entity("BlacksmithWorkshopDatabaseImplement.Models.Order", b => @@ -148,7 +148,7 @@ namespace BlacksmithWorkshopDatebaseImplement.Migrations b.HasIndex("ManufactureId"); - b.ToTable("Orders"); + b.ToTable("Orders", (string)null); }); modelBuilder.Entity("BlacksmithWorkshopDatabaseImplement.Models.ManufactureComponent", b => diff --git a/BlacksmithWorkshop/BlacksmithWorkshopDatebaseImplement/Models/Order.cs b/BlacksmithWorkshop/BlacksmithWorkshopDatebaseImplement/Models/Order.cs index 1e02a3d..2fe6388 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopDatebaseImplement/Models/Order.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopDatebaseImplement/Models/Order.cs @@ -22,7 +22,8 @@ namespace BlacksmithWorkshopDatabaseImplement.Models public DateTime? DateImplement { get; private set; } [Required] public int ClientId { get; private set; } - public Client? Client { get; private set; }//вспомогательное поле для получения ФИО клиента + [Required] + public virtual Client Client { get; private set; } = new(); public static Order? Create(OrderBindingModel model) { if (model == null)