From a326c3a247ab2e6f1a7153f5f5fd1ff8b133fb65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=BA=20=D0=98=D0=B3=D0=BE=D1=80=D1=8C?= Date: Mon, 24 Apr 2023 00:18:09 +0400 Subject: [PATCH] =?UTF-8?q?=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D1=81=D0=B2=D1=8F=D0=B7=D0=B8=20?= =?UTF-8?q?=D0=BA=D0=BB=D0=B8=D0=B5=D0=BD=D1=82=D0=B0=20=D1=81=20=D0=B7?= =?UTF-8?q?=D0=B0=D0=BA=D0=B0=D0=B7=D0=BE=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BlacksmithWorkshopDatabaseModelSnapshot.cs | 10 +++++----- .../Models/Order.cs | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) 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)