public IActionResult DeleteQuestion(int id) { var repo = new QuestionRepo(); repo.DeleteQuestion(id); return(RedirectToAction("ListAll")); }
public async Task <IActionResult> Delete(int id) { var success = await QuestionRepo.DeleteQuestion(id); if (!success) { return(NotFound()); } return(NoContent()); }
public Tuple <Quiz, List <Questions> > DeleteQuizQuestions(string QuizId, string QuestionId) { QuestionRepo repo = new QuestionRepo(); int QuizID = 0; int QuestionID = 0; int.TryParse(QuizId, out QuizID); int.TryParse(QuestionId, out QuestionID); bool result = repo.DeleteQuestion(QuizID, QuestionID); if (result) { return(repo.LoadAllQuizQuestions(QuizID)); } else { return(null); } }