public Doctor GetDoctorById(int id) { Doctor doctor = null; try { doctor = _doctorRepository.FindOne(x => x.DoctorId == id && x.IsActive == true); } catch (Exception exception) { throw new Exception(exception.Message); } return(doctor); }