From e88eecaf9713280b8ba436988b0d9b8a733ecea1 Mon Sep 17 00:00:00 2001 From: Allllen4a Date: Wed, 29 May 2024 20:19:25 +0400 Subject: [PATCH] =?UTF-8?q?=D0=B1=D0=B5=D0=B7=20=D0=BE=D1=88=D0=B8=D0=B1?= =?UTF-8?q?=D0=BA=D0=B8=20=D0=B8=20=D0=BB=D0=B0=D0=B4=D0=BD=D0=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Implements/CosmeticStorage.cs | 2 +- .../BeautySalonDatabaseImplement/Models/Cosmetic.cs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/BeautySalonView/BeautySalonDatabaseImplement/Implements/CosmeticStorage.cs b/BeautySalonView/BeautySalonDatabaseImplement/Implements/CosmeticStorage.cs index b2a8b4e..7dfa4c0 100644 --- a/BeautySalonView/BeautySalonDatabaseImplement/Implements/CosmeticStorage.cs +++ b/BeautySalonView/BeautySalonDatabaseImplement/Implements/CosmeticStorage.cs @@ -76,7 +76,7 @@ namespace BeautySalonDatabaseImplement.Implements } cosmetic.Update(model); context.SaveChanges(); - cosmetic.UpdateProcedure(context, model); + cosmetic.UpdateProcedures(context, model); transaction.Commit(); return cosmetic.GetViewModel; } diff --git a/BeautySalonView/BeautySalonDatabaseImplement/Models/Cosmetic.cs b/BeautySalonView/BeautySalonDatabaseImplement/Models/Cosmetic.cs index 3d35d17..40ba2c6 100644 --- a/BeautySalonView/BeautySalonDatabaseImplement/Models/Cosmetic.cs +++ b/BeautySalonView/BeautySalonDatabaseImplement/Models/Cosmetic.cs @@ -34,15 +34,15 @@ namespace BeautySalonDatabaseImplement.Models private Dictionary? _procedureCosmetics = null;//Это поле для хранения словаря OrderCosmetics. [NotMapped] - public Dictionary ProcedureCosmetic//представляет список косметики, участвующей в заказе. Не присутствует в базе данных. + public Dictionary ProcedureCosmetic { get { if (_procedureCosmetics == null) { _procedureCosmetics = Procedures - .ToDictionary(recPC => recPC.ProcedureId, recPC => - (recPC.Procedure as ICosmeticModel, recPC.Count)); + .ToDictionary(recPC => recPC.ProcedureId, recPC => + ((IProcedureModel)recPC.Procedure, recPC.Count)); } return _procedureCosmetics; }