Compare commits

..

No commits in common. "842ec7cded66b3d62c8b82bbfef91bc8f2bfa7eb" and "9952625971a1e95a21b0c744a5a977a06a896121" have entirely different histories.

View File

@ -79,17 +79,14 @@ namespace LawFirmDatabaseImplement.Implements
using var transaction = context.Database.BeginTransaction(); using var transaction = context.Database.BeginTransaction();
try try
{ {
var shop = context.Shops.Include(x => x.Documents).FirstOrDefault(x => x.Id == model.Id); var shop = context.Shops.FirstOrDefault(x => x.Id == model.Id);
if (shop == null) if (shop == null)
{ {
return null; return null;
} }
shop.Update(model); shop.Update(model);
context.SaveChanges(); context.SaveChanges();
if (model.ShopDocuments.Count > 0)
{
shop.UpdateDocuments(context, model); shop.UpdateDocuments(context, model);
}
transaction.Commit(); transaction.Commit();
return shop.GetViewModel; return shop.GetViewModel;
} }