public async Task <IActionResult> Edit(int id, [Bind("ID,Name,Quiz1,Quiz2,Quiz3,Assignment1,Assignment2,Assignment3,Exam")] PrelimData prelimData) { if (id != prelimData.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(prelimData); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PrelimDataExists(prelimData.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(prelimData)); }
public async Task <IActionResult> Create([Bind("ID,Name,Quiz1,Quiz2,Quiz3,Assignment1,Assignment2,Assignment3,Exam")] PrelimData prelimData) { if (ModelState.IsValid) { _context.Add(prelimData); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(prelimData)); }