Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public ActionResult Create(Question question)
- {
- if (ModelState.IsValid)
- {
- question.Answers = new List<Answer>();
- question.Answers.Add(new Answer { AnswerText = "MyAnswer" });
- db.Questions.Add(question);
- db.SaveChanges();
- return RedirectToAction("Index");
- }
- return View(question);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement