private async void Search() { var orderDtos = await _repositoryFactory().GetOrders(); var tasks = orderDtos.Select(async orderDto => _dtoMapper.Map(orderDto, await _repositoryFactory().GetItems(orderDto.Order_id))); _orders = await Task.WhenAll(tasks.ToList()); FilterOrders(); }
public HttpResponseMessage Get(int a_orderId) { Order order = m_orderRepository.GetById(a_orderId); if (order == null) { return(new HttpResponseMessage(HttpStatusCode.NotFound)); } return(Request.CreateResponse(HttpStatusCode.Accepted, m_dtoMapper.Map <Order, OrderDto>(order))); }