Пример #1
0
        public async Task <VerityResult> ConfirmOrder(List <OrderViewModel> model)
        {
            VerityResult result    = new VerityResult();
            List <Order> modellist = new List <Order>();

            foreach (var OrderItem in from item in model
                     let FindItem = _orderService.FindBy(x => x.OrderId == item.OrderId)
                                    where FindItem.Any()
                                    let OrderItem = FindItem.FirstOrDefault()
                                                    select OrderItem)
            {
                OrderItem.Status = 1;
                modellist.Add(OrderItem);
            }

            if (modellist.Any())
            {
                _orderService.UpdateMultiple(modellist);
            }

            return(await Task.Run(() => result));
        }