From b25a248c54999a5b9efb6080c05b43b2886ecb08 Mon Sep 17 00:00:00 2001 From: Programmist73 Date: Tue, 14 Mar 2023 11:09:37 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9C=D0=B5=D0=BB=D0=BA=D0=B0=D1=8F=20=D0=BF?= =?UTF-8?q?=D1=80=D0=B0=D0=B2=D0=BA=D0=B0=20(=D0=BF=D0=BE=D1=87=D0=B5?= =?UTF-8?q?=D0=BC=D1=83-=D1=82=D0=BE=20=D0=BD=D0=B5=20=D0=BE=D1=82=D0=BF?= =?UTF-8?q?=D1=80=D0=B0=D0=B2=D0=B8=D0=BB=D0=BE=D1=81=D1=8C=20=D1=81=D1=80?= =?UTF-8?q?=D0=B0=D0=B7=D1=83).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Models/Manufacture.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/Manufacture.cs b/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/Manufacture.cs index bac69ed..742aa11 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/Manufacture.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/Manufacture.cs @@ -22,21 +22,21 @@ namespace BlacksmithWorkshopDatabaseImplement.Models [Required] public double Price { get; set; } - public Dictionary? ManufactureWorkPieces = null; + public Dictionary? _manufactureWorkPieces = null; //это поле не будет "мапиться" в бд [NotMapped] - public Dictionary _manufactureWorkPieces + public Dictionary ManufactureWorkPieces { get { - if(ManufactureWorkPieces == null) + if(_manufactureWorkPieces == null) { - ManufactureWorkPieces = WorkPieces + _manufactureWorkPieces = WorkPieces .ToDictionary(recPC => recPC.WorkPieceId, recPC => (recPC.WorkPiece as IWorkPieceModel, recPC.Count)); } - return ManufactureWorkPieces; + return _manufactureWorkPieces; } } @@ -112,7 +112,7 @@ namespace BlacksmithWorkshopDatabaseImplement.Models context.SaveChanges(); } - ManufactureWorkPieces = null; + _manufactureWorkPieces = null; } } }