From a118b8fd981f8fa1ea1042dd8d3271a7b1b649f3 Mon Sep 17 00:00:00 2001
From: prodigygirl <Prodigygirl1.0@yandex.ru>
Date: Tue, 18 Apr 2023 16:28:23 +0400
Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?=
 =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../Implements/ShopStorage.cs                              | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Implements/ShopStorage.cs b/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Implements/ShopStorage.cs
index be8c7b9..7b71c26 100644
--- a/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Implements/ShopStorage.cs
+++ b/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Implements/ShopStorage.cs
@@ -160,8 +160,11 @@ namespace FurnitureAssemblyDatabaseImplement.Implements
                     return null;
                 }
                 shop.Update(model);
-                context.SaveChanges();
-                shop.UpdateFurnitures(context, model);
+                if (model.Furnitures.Count > 0)
+                {
+                    shop.UpdateFurnitures(context, model);
+                }
+                context.SaveChanges();              
                 transaction.Commit();
                 return shop.GetViewModel;
             }