Compare commits
3 Commits
9952625971
...
842ec7cded
Author | SHA1 | Date | |
---|---|---|---|
842ec7cded | |||
ca1e5c73be | |||
97736d8dde |
@ -79,14 +79,17 @@ namespace LawFirmDatabaseImplement.Implements
|
||||
using var transaction = context.Database.BeginTransaction();
|
||||
try
|
||||
{
|
||||
var shop = context.Shops.FirstOrDefault(x => x.Id == model.Id);
|
||||
var shop = context.Shops.Include(x => x.Documents).FirstOrDefault(x => x.Id == model.Id);
|
||||
if (shop == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
shop.Update(model);
|
||||
context.SaveChanges();
|
||||
if (model.ShopDocuments.Count > 0)
|
||||
{
|
||||
shop.UpdateDocuments(context, model);
|
||||
}
|
||||
transaction.Commit();
|
||||
return shop.GetViewModel;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user