public async Task <ActionResult <Question> > PostQuestion(Question question) { _IQuestion.Add(question); await _IQuestion.SaveAsync(); return(CreatedAtAction("GetQuestion", new { id = question.QuestionId }, question)); }
public IActionResult Create(Question model) { if (ModelState.IsValid) { _Question.Add(model); return(RedirectToAction("Index")); } return(View(model)); }
public int SeedQuestion(int recs, AnswerGroup _answerGroup) { // default: create 5 questions for a group ... = 5*5 for each survey for (int i = 1; i <= recs; i++) { var row = new Question { QGroup = 1, //default Order = i, QuestionText = "Question " + Convert.ToString(i), AnswerGroup = _answerGroup }; _question.Add(row); int result = SeedSurveyQuestion(10, row); //rc. 10 surveys * 25 questions each } //verify result int count = _question.GetAll().Count(); return(count); }
public static bool Add(QuestionInfo info) { return(dal.Add(info)); }