public ActionResult Edit([Bind(Include = "ID,Name,Date,Course,NumberOfQuestions,Rating,Progress")] Quiz quiz) { if (ModelState.IsValid) { db.Entry(quiz).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(quiz)); }
public async Task <IActionResult> PutDQuestion(int id, DQuestion dQuestion) { dQuestion.id = id; _context.Entry(dQuestion).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DQuestionExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }