示例#1
0
        public void GetLatitudeLongitude(string postCode, out double?latitude, out double?longitude)
        {
            var client = new PostcodesIOClient();
            var result = client.Lookup(postCode);

            latitude  = result.Latitude;
            longitude = result.Longitude;
        }
        public static DbGeography Lookup(string postcode)
        {
            PostcodesIOClient client = new PostcodesIOClient();

            var postcodeLookup = client.Lookup(postcode);

            // use the GeoUtils class to create a DbGeography object to represent the point.
            return(GeoUtils.CreatePoint(postcodeLookup.Latitude, postcodeLookup.Longitude));
        }
        public void Lookup_returns_populated_response()
        {
            var result = _client.Lookup("GU1 1AA");

            TestLookup_returns_populated_responseResult(result);
        }