public async Task <IActionResult> Create([Bind("ID,FirstName,MiddleName,LastName")] Doctor doctor) { if (ModelState.IsValid) { _context.Add(doctor); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(doctor)); }
public async Task <IActionResult> Create([Bind("ID,OHIP,FirstName,MiddleName,LastName,DOB,ExpYrVisits,Phone,eMail,DoctorID")] Patient patient) { if (ModelState.IsValid) { _context.Add(patient); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["DoctorID"] = new SelectList(_context.Doctors, "ID", "FirstName", patient.DoctorID); return(View(patient)); }