public ActionResult Delete(CountryDelete value) { if (value == null) { throw new ArgumentNullException("value"); } var country = this.CountryService.GetById(value.Id); if (country == null) { return HttpNotFound(); } var privilege = new CountryPrivilege(); if (!privilege.CanDelete(country)) { return NotAuthorized(); } this.CountryService.Delete(country); return base.RedirectToRoute(AdministrationRoutes.CountryIndex); }
public ActionResult Delete(int id) { var country = this.CountryService.GetById(id); if (country == null) { return HttpNotFound(); } var privilege = new CountryPrivilege(); return privilege.CanDelete(country) ? base.View(Views.Delete, new CountryDelete(country)) : NotAuthorized(); }