From e3dfb7b0c0a54610e11ede924cd94bfa6f925044 Mon Sep 17 00:00:00 2001 From: antoc0der <1@DESKTOP-K1L8ND3> Date: Fri, 15 Mar 2024 22:27:17 +0400 Subject: [PATCH] =?UTF-8?q?=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FlowerShopFileImplement/FlowerStorage.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/FlowerShopFileImplement/FlowerStorage.cs b/FlowerShopFileImplement/FlowerStorage.cs index c06d89a..e1ac660 100644 --- a/FlowerShopFileImplement/FlowerStorage.cs +++ b/FlowerShopFileImplement/FlowerStorage.cs @@ -67,25 +67,25 @@ namespace FlowerShopFileImplement.Implements public FlowerViewModel? Update(FlowerBindingModel model) { - var iceCream = source.Flowers.FirstOrDefault(x => x.Id == + var flower = source.Flowers.FirstOrDefault(x => x.Id == model.Id); - if (iceCream == null) + if (flower == null) { return null; } - iceCream.Update(model); + flower.Update(model); source.SaveFlowers(); - return iceCream.GetViewModel; + return flower.GetViewModel; } public FlowerViewModel? Delete(FlowerBindingModel model) { - var iceCream = source.Flowers.FirstOrDefault(x => x.Id == + var flower = source.Flowers.FirstOrDefault(x => x.Id == model.Id); - if (iceCream != null) + if (flower != null) { - source.Flowers.Remove(iceCream); + source.Flowers.Remove(flower); source.SaveFlowers(); - return iceCream.GetViewModel; + return flower.GetViewModel; } return null; }