public IActionResult Delete(int?Id) { var user = _Question.GetQuestionById(Id); if (user == null) { return(RedirectToAction("Index")); } return(View(user)); }
/// <summary> /// Return question /// </summary> /// <returns>Question</returns> public JsonResult ListQuestion() { List <int> QuestionIds = Session["QuestionIds"] as List <int>; if (QuestionIds.Count > 0) { int id = QuestionIds[0]; QuestionIds.RemoveAt(0); Session["QuestionIds"] = QuestionIds; int questionCount = int.Parse(Session["QuestionCount"].ToString()); int questionNumber = int.Parse(Session["QuestionNumber"].ToString()); var question = questionImpl.GetQuestionById(id); var quest = new { QuestionNumber = questionNumber, QuestionCount = questionCount, Question = question }; Session["QuestionNumber"] = questionNumber + 1; return(Json(quest, JsonRequestBehavior.AllowGet)); } return(null); }
public void GetQuestionById(int questionId) { Question question = _questionImpl.GetQuestionById(1); Assert.IsNotNull(question); }
public static QuestionInfo GetQuestionById(int id) { return(dal.GetQuestionById(id)); }