public ActionResult Edit(int id) { SellerPanelViewModel productToEdit = sp.GetItemById(id); if (productToEdit == null) { ModelState.AddModelError("Error", "Product to edit not found"); return(View(productToEdit)); } return(View(productToEdit)); }