public async Task <IActionResult> Edit(int id, [Bind("ExamId,Name")] tblExam tblExam) { if (id != tblExam.ExamId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(tblExam); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!tblExamExists(tblExam.ExamId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(tblExam)); }
public async Task <IActionResult> Create([Bind("ExamId,Name")] tblExam tblExam) { if (ModelState.IsValid) { _context.Add(tblExam); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(tblExam)); }