public ActionResult AddShoeSubmit(Shoe shoe, HttpPostedFileBase file) { if (file != null && file.ContentLength > 0) { shoe.Image = file.FileName; string appPath = Request.PhysicalApplicationPath; file.SaveAs(appPath + @"\Content\Images\Shoes\" + file.FileName); } shoeFac.Add(shoe); return(RedirectToAction("Index")); }
public IActionResult AddShoe(Shoe newShoe) { shoeFactory.Add(newShoe); return(RedirectToAction("Index")); }