public IActionResult Payments()
        {
            var result = _paymentsRepository.GetPayments().Select(x =>
                                                                  new PaymentViewModel()
            {
                PaymentNotice = x,
                Order         = _orderRepository.GetOrderByBookingId(x.BookingId) ?? new Order()
            });

            return(View(result));
        }
示例#2
0
        public async Task <IActionResult> Payments()
        {
            var orders = await _orderRepository.GetAllAsync();

            var result = _paymentsRepository.GetPayments().Select(x =>
            {
                var item = new PaymentViewModel()
                {
                    PaymentNotice = x,
                    Order         = orders.FirstOrDefault(y => x.BookingId == y.BookingId)
                };
                return(item);
            }).ToArray();

            return(View(result));
        }