Esempio n. 1
0
 public GeoInformationController( IGeoIPService geoIpService, IObjectMappingService objectMappingService,
     IDiagnosticsTracingService diagnosticsTracingService, IPrincipalService principalService) 
     : base(diagnosticsTracingService, principalService)
 {
     _geoIpService = geoIpService;
     _objectMappingService = objectMappingService;
 }
Esempio n. 2
0
        private static async Task<IGeoIPService> GetResolverAsync() {
            if (_service != null)
                return _service;

            var dataDirectory = PathHelper.ExpandPath(".\\");
            var storage = new FolderFileStorage(dataDirectory);

            if (!await storage.ExistsAsync(MindMaxGeoIPService.GEO_IP_DATABASE_PATH)) {
                var job = new DownloadGeoIPDatabaseJob(new InMemoryCacheClient(), storage);
                var result = await job.RunAsync();
                Assert.NotNull(result);
                Assert.True(result.IsSuccess);
            }

            return _service = new MindMaxGeoIPService(storage);
        }
Esempio n. 3
0
        private static async Task <IGeoIPService> GetResolverAsync()
        {
            if (_service != null)
            {
                return(_service);
            }

            var dataDirectory = PathHelper.ExpandPath(".\\");
            var storage       = new FolderFileStorage(dataDirectory);

            if (!await storage.ExistsAsync(MindMaxGeoIPService.GEO_IP_DATABASE_PATH))
            {
                var job    = new DownloadGeoIPDatabaseJob(new InMemoryCacheClient(), storage);
                var result = await job.RunAsync();

                Assert.NotNull(result);
                Assert.True(result.IsSuccess);
            }

            return(_service = new MindMaxGeoIPService(storage));
        }
 public GeoPlugin(IGeoIPService geoIpService) {
     _geoIpService = geoIpService;
 }
Esempio n. 5
0
 public GeoPlugin(IGeoIPService geoIpService)
 {
     _geoIpService = geoIpService;
 }