public async Task <IHttpActionResult> Delete(string testId) { var result = await TestsDao.Delete(this, testId); if (result == null) { return(NotFound()); } return(JsonWithPermissions(result)); }
public async Task <ActionResult> ConfirmDelete(Test test) { if (test != null) { try { await TestsDao.Delete(this, test); } catch (Exception) { return(RedirectToAction("Delete", new { test = test.TestId, cannotDelete = true })); } } return(RedirectToAction("Index")); }