public ActionResult Delete(MAction viewModel, FormCollection formCollection) { MAction mActionToDelete = _mActionRepository.Get(viewModel.Id); if (mActionToDelete != null) { _mActionRepository.Delete(mActionToDelete); } try { _mActionRepository.DbContext.CommitChanges(); } catch (Exception e) { _mActionRepository.DbContext.RollbackTransaction(); return(Content(e.GetBaseException().Message)); } return(Content("success")); }