Esempio n. 1
0
        public async Task <Maybe <Coordinates> > GetCoordinates(string postcode)
        {
            try {
                var result = await web.GetAsync <GetCoordinatesResult>($"https://api.postcodes.io/postcodes/{postcode.Trim()}").ConfigureAwait(false);

                return((result == null || result.Result == null) ? null : result.Result);
            }
            catch (Exception)
            {
                return(Maybe <Coordinates> .None);
            }
        }