Ejemplo n.º 1
0
 public static List <City> GetCities()
 {
     using (RepositoryCity repositoryCity = new RepositoryCity())
     {
         return(repositoryCity.WhereWithExplicitLoad(I => true, I => I.OrderBy(J => J.Name), paths: new string[] { "Counties" }).ToList());
     }
 }
Ejemplo n.º 2
0
        public List <City> GetHospitalCities()
        {
            using (RepositoryCity repositoryCity = new RepositoryCity())
            {
                List <Hospital> hospitals = new List <Hospital>();
                using (RepositoryHospital repositoryHospital = new RepositoryHospital())
                {
                    hospitals = repositoryHospital.WhereWithExplicitLoad(I => I.IsActive == true).ToList();
                }

                List <City> cities = new List <City>();
                foreach (var item in hospitals)
                {
                    cities.AddRange(repositoryCity.WhereWithExplicitLoad(I => I.Name == item.City, I => I.OrderBy(J => J.Name)).ToList());
                }

                return(cities.Distinct().ToList());
            }
        }