public IEnumerable <Medication> GetAllOnValidationForDoctor(Doctor doctor)
        {
            var allOnValidation           = medicationRepository.GetAllOnValidation().ToList();
            List <Medication> validations = new List <Medication>();

            foreach (Medication medication in allOnValidation)
            {
                foreach (MedicationCategory medicationCategory in medication.MedicationCategory)
                {
                    foreach (Specialization specialization in doctor.Specializations)
                    {
                        if (specialization.SpecializationName.Equals(medicationCategory.Specialization.SpecializationName))
                        {
                            validations.Add(medication);
                        }
                    }
                }
            }
            CheckIfAlreadyValidated(validations, doctor);
            return(validations);
        }
Esempio n. 2
0
 public List <Domain.Entities.Medications.Medication> GetAllOnValidation() =>
 _medicationRepository.GetAllOnValidation();