コード例 #1
0
        public IActionResult Orders()
        {
            NorthwindDb     db = new NorthwindDb(_connectionString);
            OrdersViewModel vm = new OrdersViewModel();

            vm.Orders      = db.GetOrders();
            vm.CurrentDate = DateTime.Now;
            return(View(vm));
        }
コード例 #2
0
        public ActionResult Orders()
        {
            NorthwindDb         db        = new NorthwindDb(_connectionString);
            List <Order>        orders    = db.GetOrders();
            OrdersPageViewModel viewModel = new OrdersPageViewModel
            {
                Orders = orders,
                Date   = DateTime.Now
            };

            return(View(viewModel));
        }