From aa4538f8119d4df5e5367ef8fcdf3803b22e468e Mon Sep 17 00:00:00 2001 From: malimova Date: Sat, 27 Apr 2024 12:38:39 +0400 Subject: [PATCH] =?UTF-8?q?=D0=BA=20=D1=81=D0=B4=D0=B0=D1=87=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ConfectioneryDatabaseImplement/PastryStorage.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Confectionery/ConfectioneryDatabaseImplement/PastryStorage.cs b/Confectionery/ConfectioneryDatabaseImplement/PastryStorage.cs index 887cb44..eaa4896 100644 --- a/Confectionery/ConfectioneryDatabaseImplement/PastryStorage.cs +++ b/Confectionery/ConfectioneryDatabaseImplement/PastryStorage.cs @@ -74,17 +74,17 @@ namespace ConfectioneryDatabaseImplement.Implements using var transaction = context.Database.BeginTransaction(); try { - var product = context.Pastrys.FirstOrDefault(rec => + var pastry = context.Pastrys.FirstOrDefault(rec => rec.Id == model.Id); - if (product == null) + if (pastry == null) { return null; } - product.Update(model); + pastry.Update(model); context.SaveChanges(); - product.UpdateComponents(context, model); + pastry.UpdateComponents(context, model); transaction.Commit(); - return product.GetViewModel; + return pastry.GetViewModel; } catch {