private static RestRequest CreateLookupLocationRequest(ReverseGeocodeQuery query) { var request = new RestRequest("postcodes", Method.GET); request.AddParameter("lat", query.Latitude); request.AddParameter("lon", query.Longitude); if (query.Limit.HasValue) { request.AddParameter("limit", query.Limit); } return(request); }
public Task <IEnumerable <PostcodeResult> > LookupLatLonAsync(ReverseGeocodeQuery query) { var request = CreateLookupLocationRequest(query); return(ExecuteAsync <List <PostcodeResult> >(request).ContinueWith(t => t.Result as IEnumerable <PostcodeResult>, TaskContinuationOptions.OnlyOnRanToCompletion)); }
public IEnumerable <PostcodeResult> LookupLatLon(ReverseGeocodeQuery query) { var request = CreateLookupLocationRequest(query); return(Execute <List <PostcodeResult> >(request)); }