示例#1
0
        public IEnumerable <Country> GetCountries()
        {
            var countries = SimpleCache.Get(
                Source.GetCountries,
                GeoCacheTimeoutSeconds, "MemCacheClient.GetCountries"
                );

            return(countries.Result);
        }
示例#2
0
        public IEnumerable <Region> GetRegions(string countryCode, Verbosity style)
        {
            var regions = SimpleCache.Get(
                () => Source.GetRegions(countryCode, style),
                GeoCacheTimeoutSeconds, "MemCacheClient.GetRegions", countryCode, style
                );

            return(regions.Result);
        }
示例#3
0
        public Toponym Get(int geoNameId, Verbosity style)
        {
            var top = SimpleCache.Get(
                () => Source.Get(geoNameId, style),
                GeoCacheTimeoutSeconds, "MemCacheClient.Get", geoNameId, style
                );

            return(top.Result);
        }
示例#4
0
        public IEnumerable <City> GetCities(string countryCode, string regionCode, Verbosity style)
        {
            var cities = SimpleCache.Get(
                () => Source.GetCities(countryCode, regionCode, style),
                GeoCacheTimeoutSeconds, "MemCacheClient.GetCities", countryCode, regionCode, style
                );

            return(cities.Result);
        }
示例#5
0
        public StreetAddress FindNearestAddress(float latitude, float longitude, Verbosity style)
        {
            var address = SimpleCache.Get(
                () => Source.FindNearestAddress(latitude, longitude, style),
                GeoCacheTimeoutSeconds, "MemCacheClient.FindNearestAddress", latitude, longitude, style
                );

            return(address.Result);
        }
示例#6
0
        public IEnumerable <Place> FindNearbyPlaces(float latitude, float longitude, float radius, int maxRows, Verbosity style)
        {
            var places = SimpleCache.Get(
                () => Source.FindNearbyPlaces(latitude, longitude, radius, maxRows, style),
                GeoCacheTimeoutSeconds, "MemCacheClient.FindNearbyPlaces", latitude, longitude, radius, maxRows, style
                );

            return(places.Result);
        }
示例#7
0
        public IEnumerable <PostalCode> PostalCodeLookup(string countryCode, string postalCode, int maxRows, Verbosity style)
        {
            var location = SimpleCache.Get(
                () => Source.PostalCodeLookup(countryCode, postalCode, maxRows, style),
                GeoCacheTimeoutSeconds, "MemCacheClient.PostalCodeLookup", countryCode, postalCode, maxRows, style
                );

            return(location.Result);
        }
示例#8
0
        public LookupResult LookupLocation(float latitude, float longitude)
        {
            var location = SimpleCache.Get(
                () => Source.LookupLocation(latitude, longitude),
                GeoCacheTimeoutSeconds, "MemCacheClient.LookupLocation", latitude, longitude
                );

            return(location.Result);
        }
示例#9
0
        public IEnumerable <Toponym> Hierarchy(int geoNameId, Verbosity style)
        {
            var hier = SimpleCache.Get(
                () => Source.Hierarchy(geoNameId, style),
                GeoCacheTimeoutSeconds, "MemCacheClient.Hierarchy", geoNameId, style
                );

            return(hier.Result);
        }