コード例 #1
0
        // GET: Order/History
        public async Task <IActionResult> History()
        {
            IEnumerable <OrderHistoryDto> orderHistory = null;

            try
            {
                orderHistory = await _orderFacade.GetOrders(1);

                /*orderHistory = await _orderFacade.GetOrders(customerId);*/
            }
            catch (HttpRequestException)
            {
                _logger.LogWarning("Exception Occured using Order Facade");
                orderHistory = null;
            }

            IEnumerable <OrderHistoryViewModel> viewModel = orderHistory.Select(o => new OrderHistoryViewModel
            {
                OrderId    = o.OrderId,
                Date       = o.Date,
                TotalPrice = o.TotalPrice,
            });

            return(View(viewModel));
        }
コード例 #2
0
 public IEnumerable <OrderDto> Get()
 {
     return(_orderFacade.GetOrders());
 }