Beispiel #1
0
        public async Task <OrderDetail> UpdateOrderDetailAsync(OrderDetail orderDetail)
        {
            var orderIdBytes        = orderDetail.Id.ToByteArray();
            var orderDetailToUpdate = await _orderContext.Order.FirstOrDefaultAsync(x => _orderContext.Database.IsInMemory()?x.Id.SequenceEqual(orderIdBytes) : x.Id == orderIdBytes);

            orderDetailToUpdate.StatusId = orderDetail.StatusId.ToByteArray();

            await _orderContext.SaveChangesAsync();

            orderDetail.StatusName = orderDetailToUpdate.Status.Name;

            return(orderDetail);
        }
 public async Task UpdateOrder()
 {
     await _orderContext.SaveChangesAsync();
 }