예제 #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;
 }