public NeighborhoodCollection()
        {
            List <Neighborhood> neighborhoods = new List <Neighborhood>();

            List <City> cities = new CityCollection().Cities;

            neighborhoods.Add(new Neighborhood("пл. Ленина", "1а", cities.Find(c => c.CityCode == 111)));
            neighborhoods.Add(new Neighborhood("б-р Штоккерау", "25", cities.Find(c => c.CityCode == 112)));
            neighborhoods.Add(new Neighborhood("Сиднейская", "110", cities.Find(c => c.CityCode == 111)));
            neighborhoods.Add(new Neighborhood("Мельбурнская", "01", cities.Find(c => c.CityCode == 311)));

            Neighborhoods = neighborhoods;
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            List <Country>      cc  = new CountryCollection().Countries;
            List <District>     dc  = new DistrictCollection().Districts;
            List <City>         ctc = new CityCollection().Cities;
            List <Neighborhood> nbc = new NeighborhoodCollection().Neighborhoods;

            var results = from country in cc
                          join d in dc on country.CountryCode equals d.Country.CountryCode
                          join ct in ctc on d.DistrictCode equals ct.District.DistrictCode
                          join nb in nbc on ct.CityCode equals nb.City.CityCode
                          select new { nb.StreetName };

            foreach (var result in results)
            {
                Console.WriteLine($"street: {result.StreetName}");
            }
            Console.ReadKey();
        }