public ActionResult Delete(Guid id, IFormCollection collection) { try { var sample = _sampleApplicationService.GetById(id); _sampleApplicationService.Remove(sample); return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Delete([FromRoute] Guid id) { try { var sample = _sampleApplicationService.GetById(id); _sampleApplicationService.Remove(sample); return(Ok()); } catch (Exception e) { return(BadRequest(e)); } }