ISEbd-22 Alimova M.S. Lab Work 04 base #5

Closed
malimova wants to merge 20 commits from Lab4_base into Lab3_base
Showing only changes of commit aa4538f811 - Show all commits

View File

@ -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
{