public IActionResult Delete(int id) { if (_sectionManager.HasQuestions(id)) { return(BadRequest("You must delete all questions to continue")); } var section = _sectionManager.DeleteSection(id); return(Ok(section)); }
private void btnDelete_ServerClick(object sender, System.EventArgs e) { // user wants to delete the section bool result = SectionManager.DeleteSection(_sectionID); if (result) { // succeeded. // invalidate cache CacheManager.InvalidateCachedItem(CacheKeys.AllSections); // redirect to modifydelete form Response.Redirect("ModifyDeleteSection.aspx", true); } }