Esempio n. 1
0
        public async Task DeleteDoctor(DeleteDoctorCommand deleteDoctorCommand)
        {
            var doctorId = deleteDoctorCommand.DoctorId;
            var doctor   = await FindDoctor(doctorId);

            _context.Doctors.Remove(doctor);
            await _context.SaveChangesAsync();
        }
Esempio n. 2
0
        public void Should_Delete_A_Doctor()
        {
            DeleteDoctorCommand command = new DeleteDoctorCommand()
            {
                DoctorId = doctorRepository.doctors[0].Id
            };

            Assert.IsNotNull(_handler.Handler(command));
        }
Esempio n. 3
0
 public ICommandResult Handler(DeleteDoctorCommand command)
 {
     _doctorRepository.Delete(command.DoctorId);
     return(new DeleteDoctorCommandResult(command.DoctorId, true));
 }