Пример #1
0
        static void Main(string[] args)
        {
            var context     = new world.worldContext(Helper.GetDatabaseConnectionString());
            var cityService = new world.CityService(context);
            var c           = cityService.GetCity(777);

            Console.WriteLine(c.Name ?? "NOT FOUND");

            var cRijeka = cityService.FindCitiesByName("Rijeka");

            foreach (var cR in cRijeka)
            {
                Console.WriteLine($"{cR.Id} - {cR.Name}");
            }

            var cHrv = cityService.FindCitiesByCountryCode("HRV");

            foreach (var cHr in cHrv)
            {
                Console.WriteLine($"{cHr.Id} - {cHr.Name}");
            }
        }
Пример #2
0
 public CityService(worldContext ctx)
 {
     _context = ctx;
 }