Example #1
0
        public IActionResult Create([Bind("FirstName,LastName,City,Email,Phone")] Dentist newDentist)
        {
            if (!ModelState.IsValid)
            {
                return(View(newDentist));
            }

            _dentistService.Create(newDentist);

            var _listOfDentists = _dentistService.ReadAll().OrderBy(p => p.Id).ToList();

            return(RedirectToAction(nameof(ReadAll), _listOfDentists));
        }
Example #2
0
 public IActionResult Create()
 {
     ViewData["PatientId"] = new SelectList(_patientService.ReadAll(), "Id", "FullName");
     ViewData["DentistId"] = new SelectList(_dentistService.ReadAll(), "Id", "FullName");
     return(View());
 }