コード例 #1
0
        public IActionResult Edit(int?id)
        {
            var model = id != null
                ? new EditDeliveryInfoViewModel(_service.GetDeliveryInfoItem(id.Value))
                : new EditDeliveryInfoViewModel();

            model.Products = _service.GetProductItems().Select(a => new SelectListItem(a.Name, a.Id.ToString()));
            model.Sellers  = _service.GetSellerItems().Select(a => new SelectListItem(a.Name, a.Id.ToString()));
            return(View(model));
        }
コード例 #2
0
        public IActionResult Index()
        {
            var result = _service.GetProductItems();

            return(View(new DisplayProductsViewModel
            {
                Items = result
            }));
        }