public async Task <IActionResult> Edit(int id, [Bind("Id,Answer")] Survey survey) { if (id != survey.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(survey); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SurveyExists(survey.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(survey)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Level,Order,Question")] QMaster qMaster) { if (id != qMaster.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(qMaster); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!QMasterExists(qMaster.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(qMaster)); }