к сдаче
This commit is contained in:
parent
ab3ce507e2
commit
aa4538f811
@ -74,17 +74,17 @@ namespace ConfectioneryDatabaseImplement.Implements
|
|||||||
using var transaction = context.Database.BeginTransaction();
|
using var transaction = context.Database.BeginTransaction();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var product = context.Pastrys.FirstOrDefault(rec =>
|
var pastry = context.Pastrys.FirstOrDefault(rec =>
|
||||||
rec.Id == model.Id);
|
rec.Id == model.Id);
|
||||||
if (product == null)
|
if (pastry == null)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
product.Update(model);
|
pastry.Update(model);
|
||||||
context.SaveChanges();
|
context.SaveChanges();
|
||||||
product.UpdateComponents(context, model);
|
pastry.UpdateComponents(context, model);
|
||||||
transaction.Commit();
|
transaction.Commit();
|
||||||
return product.GetViewModel;
|
return pastry.GetViewModel;
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user