示例#1
0
        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();
        }
示例#2
0
        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}");
            }
        }
示例#3
0
    public Task UpdateOrderAsync(Order order)
    {
        _orderingContext.Update(order);

        return(_orderingContext.SaveChangesAsync());
    }