コード例 #1
0
        public IActionResult Geocode(GeocodeViewModel viewModel)
        {
            var locations = _locationRepository.GetAll();

            foreach (var location in locations)
            {
                var coords = _geocodingService.GetCoordinates(location.Name);
                location.Lat  = coords["lat"];
                location.Long = coords["long"];
                _locationRepository.Update(location);
            }
            return(View(new GeocodeViewModel()));
        }