public ActionResult Create(Question question) { if (ModelState.IsValid) { db.Questions.Add(question); db.SaveChanges(); return(RedirectToRoute(new { controller = "A", action = "Create", id = question.QuestionId })); } return(View(question)); }
public ActionResult Create(TestModel testmodel) { if (ModelState.IsValid) { db.Tests.Add(testmodel); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(testmodel)); }
public ActionResult Create(AnswerVariant answervariant) { if (ModelState.IsValid) { db.AnswerVariants.Add(answervariant); db.SaveChanges(); return(RedirectToRoute(new { controller = "A", action = "Create", id = answervariant.QuestionId })); } return(RedirectToRoute("Error")); }