public async Task <IActionResult> Edit(int id, [Bind("ID,Name,Quiz1,Quiz2,Quiz3,Assignment1,Assignment2,Assignment3,Exam")] FinalsData finalsData) { if (id != finalsData.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(finalsData); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!FinalsDataExists(finalsData.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(finalsData)); }
public async Task <IActionResult> Edit(int id, [Bind("ID,Name,Course,Address,ContactNo")] StudentInfo studentInfo) { if (id != studentInfo.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(studentInfo); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!StudentInfoExists(studentInfo.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(studentInfo)); }