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)); }
public async Task <IActionResult> Create([Bind("Id,Level,Order,Question")] QMaster qMaster) { if (ModelState.IsValid) { _context.Add(qMaster); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(qMaster)); }
public void Update(QMaster newQuestion) { throw new NotImplementedException(); }
public void Add(QMaster newQuestion) { _context.Add(newQuestion); _context.SaveChanges(); }