public ActionResult DeleteConfirmed(int id) { try { var company = _companyApp.GetById(id); _companyApp.Remove(company); return(RedirectToAction("Index")); } catch { return(RedirectToAction("Index")); } }
public ActionResult DeleteConfirmed([Bind(Include = "Id")] Guid id) { var company = _companyAppService.GetById(id); if (company == default(CompanyViewModel)) { return(HttpNotFound()); } try { _companyAppService.Remove(company); return(RedirectToAction("Index")); } catch { return(View(company)); } }