public IActionResult Delete(int id) { IActionResult _result = new ObjectResult(false); GenericResult _removeResult = null; try { Problem _problemToRemove = this._problemRepository.GetSingle(id); _problemRepository.Delete(_problemToRemove); _problemRepository.Commit(); _removeResult = new GenericResult() { Succeeded = true, Message = "Problem removed." }; } catch (Exception ex) { _removeResult = new GenericResult() { Succeeded = false, Message = ex.Message }; _loggingRepository.Add(new Error() { Message = ex.Message, StackTrace = ex.StackTrace, DateCreated = DateTime.Now }); _loggingRepository.Commit(); } _result = new ObjectResult(_removeResult); return(_result); }
public void Delete(Guid id) { _problemRepository.Delete(id); }
public ActionResult Delete(int id) { repo.Delete(id); return(RedirectToAction("Index")); }
public void DeleteProblem(Problem selectedProblem) { //conn.DeleteProblem(selectedProblem); _problemRepository.Delete(selectedProblem); }
public IActionResult DeleteConfirmed(Guid problemId) { _problemRepository.Delete(problemId); _problemRepository.Save(); return(View("Index")); }