public async Task <IActionResult> Edit(int id, [Bind("ID,Volunteer,ShiftDate,Location,StartTime,EndTime")] Shift shift) { if (id != shift.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(shift); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ShiftExists(shift.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(shift)); }