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)); }
public IActionResult Index() { var result = _service.GetProductItems(); return(View(new DisplayProductsViewModel { Items = result })); }