// GET: Instances/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Instance instance = instanceService.GetInstance(id); //var filePath = Server.MapPath(path); if (instance.resourceAddress != null && !instance.resourceAddress.StartsWith("http")) { customService.RemoveFile(instance.resourceAddress); } if (instance == null) { return(HttpNotFound()); } return(View(instance)); }