Exemplo n.º 1
0
        public static void AddContinents()
        {
            ContinentRepository cr = new ContinentRepository();

            cr.SaveContinent(new Continent()
            {
                name = "North America"
            });
            cr.SaveContinent(new Continent()
            {
                name = "South America"
            });
            cr.SaveContinent(new Continent()
            {
                name = "Africa"
            });
            cr.SaveContinent(new Continent()
            {
                name = "Antarctica"
            });
            cr.SaveContinent(new Continent()
            {
                name = "Australia"
            });
            cr.SaveContinent(new Continent()
            {
                name = "Eurasia"
            });
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            ContinentRepository continentRepo = new ContinentRepository();
            CountryRepositories countryRepo   = new CountryRepositories();
            CityRepositories    cityRepo      = new CityRepositories();

            //AddContinents();
            //AddCountries();
            //AddCities();
            Console.WriteLine("***Continents:");
            continentRepo.Print();

            Console.WriteLine("***Countries:");
            countryRepo.Print();

            Console.WriteLine("***Cities:");
            cityRepo.Print();

            City city = cityRepo.Cities.FirstOrDefault(c => c.name == "Berlin");

            Console.WriteLine("Find city: {0}", city);

            Console.ReadLine();
        }