/// <summary> /// Adds Patient to specific doctor's list of patients /// </summary> /// <param name="patient"></param> /// <param name="doctorId"></param> /// <returns>patientID if successfully added patient, else invalid value ‘-1’</returns> public Patient AddPatient(int doctorId, string firstName, string lastName, int age, Gender gender, string healthCardNumber, string phoneNumber, string address) { var patient = new Patient { FirstName = firstName, LastName = lastName, Age = age, Gender = gender, HealthCardNumber = healthCardNumber, PhoneNumber = phoneNumber, Address = address }; _patientRepository.AddPatient(patient); Doctor doctor = _doctorRepository.GetDoctor(doctorId); _doctorRepository.AssignPatient(doctorId, patient.PatientId); return(patient); }