public string Delete(int id) { Brand brand = _repo.Get(id); if (brand == null) { throw new Exception("Invalid Id Homie"); } _repo.Delete(id); return("Successfully Booted"); }
public ActionResult DeleteConfirmed(int id) { var image = _repo.Get(id); //#region Delete Image //if (image.Image != null) //{ // if (System.IO.File.Exists(Server.MapPath("/Files/BrandsImages/" + image.Image))) // System.IO.File.Delete(Server.MapPath("/Files/BrandsImages/" + image.Image)); // if (System.IO.File.Exists(Server.MapPath("/Files/BrandsImages/" + image.Image))) // System.IO.File.Delete(Server.MapPath("/Files/BrandsImages/" + image.Image)); //} //#endregion _repo.Delete(id); return(RedirectToAction("Index")); }