public static async Task SetProgress( OrderingDbContext context, Order order, bool catalogueSolutionsViewed, bool additionalServicesViewed, bool associatedServicesViewed) { order.Progress.CatalogueSolutionsViewed = catalogueSolutionsViewed; order.Progress.AdditionalServicesViewed = additionalServicesViewed; order.Progress.AssociatedServicesViewed = associatedServicesViewed; context.Update(order); await context.SaveChangesAsync(); }
public async Task <T> UpdateAsync(T entity) { if (entity == null) { throw new ArgumentNullException($"{nameof(AddAsync)} entity must not be null"); } try { _context.Update(entity); await _context.SaveChangesAsync(); return(entity); } catch (Exception ex) { throw new Exception($"{nameof(entity)} could not be updated: {ex.Message}"); } }
public Task UpdateOrderAsync(Order order) { _orderingContext.Update(order); return(_orderingContext.SaveChangesAsync()); }