public async Task <int> UpdateAsync(int id, PackingModel model) { using (var transaction = dbContext.Database.BeginTransaction()) { try { await packingLogic.UpdateModelAsync(id, model); var row = await dbContext.SaveChangesAsync(); //if (row > 0) //{ // await CreateProduct(model); //} transaction.Commit(); return(row); } catch (Exception ex) { transaction.Rollback(); throw ex; } } }
public async Task <int> UpdateAsync(int id, PackingModel model) { packingLogic.UpdateModelAsync(id, model); return(await dbContext.SaveChangesAsync()); }