public CountryController(IGeographyService context)
 {
     _context = context;
 }
Esempio n. 2
0
 public GeographyCrawler(CrawlOptions crawlOptions, IGeographyService geographyService) : base(crawlOptions)
 {
     _geographyService = geographyService;
 }
Esempio n. 3
0
 public GeographyHostedService(ILogger <GeographyHostedService> logger, GeographyCrawler crawler, IGeographyService geographyService)
 {
     _logger           = logger;
     _crawler          = crawler;
     _geographyService = geographyService;
 }
 public RegionController(IGeographyService context)
 {
     _context = context;
 }
Esempio n. 5
0
 public StateController(IGeographyService context)
 {
     _context = context;
 }
Esempio n. 6
0
 public GeographyController(IGeographyService geographyService)
 {
     this.geographyService = geographyService;
 }
Esempio n. 7
0
 public Geography(IGeographyService geographyService)
     : this()
 {
     this.GeographyService = geographyService;
 }
Esempio n. 8
0
        public static void GeocodeOrgUnit(OrgUnit orgUnit, IGeographyService geographyService, string completeAddress, bool forceGeocode)
        {
            try
            {
                var IsInvalidLatLongValues = IsInvalidLatLong(orgUnit.Latitude, orgUnit.Longitude);

                if (forceGeocode || IsInvalidLatLongValues)
                {
                    var latLonPair = geographyService.GeocodeAddress(completeAddress);
                    if (latLonPair != null)
                    {
                        orgUnit.Latitude = string.IsNullOrEmpty(latLonPair.Latitude) ? new decimal?() : decimal.Parse(latLonPair.Latitude, CultureInfo.InvariantCulture);
                        orgUnit.Longitude = string.IsNullOrEmpty(latLonPair.Longitude) ? new decimal?() : decimal.Parse(latLonPair.Longitude, CultureInfo.InvariantCulture);
                    }
                }
            }
            catch (Exception ex)
            {
                throw new BusinessException("Error geocoding address: " + ex.Message);
            }
        }