private QuizManager() { quiz = new Quiz(); quiz.StartTime = DateTime.Now; quiz.QuizId = 1; quiz.Score = 0 ; }
public ActionResult Edit(Quiz quiz) { if (ModelState.IsValid) { db.Entry(quiz).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(quiz); }
public ActionResult Create(Quiz quiz) { if (ModelState.IsValid) { db.Quizs.Add(quiz); db.SaveChanges(); return RedirectToAction("Index"); } return View(quiz); }