public async Task <IActionResult> Edit(int id, [Bind("AppointmentId,FirstName,LastName,PhoneNumber,Date,Time")] Appointment appointment) { if (id != appointment.AppointmentId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(appointment); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AppointmentExists(appointment.AppointmentId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(appointment)); }
public async Task <IActionResult> Edit(int id, [Bind("QuestionId,Question")] DonorQuestion donorQuestion) { if (id != donorQuestion.QuestionId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(donorQuestion); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DonorQuestionExists(donorQuestion.QuestionId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(donorQuestion)); }