Exemplo n.º 1
0
        public async Task <IActionResult> EditDoctor(int id, DoctorDto doctorDto)
        {
            var doctor = await _context.Doctors.FindAsync(id);

            if (doctor == null)
            {
                return(NotFound());
            }

            doctor.FirstName = doctorDto.FirstName;
            doctor.LastName  = doctorDto.LastName;
            doctor.Email     = doctorDto.Email;

            await _context.SaveChangesAsync();

            return(Ok());
        }