Esempio n. 1
0
        /// <summary>
        /// Return data for the supplied UK address ID as an asynchronous operation.
        /// </summary>
        /// <param name="link">A link returned in a GetGbBuildingData response.</param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        public async Task <Model.GetGbBuildingData.Response> GetGbBuildingDataAsync(Model.GetGbBuildingData.Link link)
        {
            if (link == null)
            {
                throw new ArgumentNullException(nameof(link));
            }

            Uri requestUri = link.Href;
            var response   = await GetResponseAsync <Model.GetGbBuildingData.Response>(link, requestUri);

            return(response);
        }
Esempio n. 2
0
        /// <summary>
        /// Return data for the supplied UK address ID.
        /// </summary>
        /// <param name="link">A link returned in a GetGbBuildingData response.</param>
        /// <returns>GetGbBuildingData response.</returns>
        public Model.GetGbBuildingData.Response GetGbBuildingData(Model.GetGbBuildingData.Link link)
        {
            try
            {
                return(GetGbBuildingDataAsync(link).Result);
            }
            catch (Exception e)
            {
                if (e.InnerException != null)
                {
                    throw e.InnerException;
                }

                throw;
            }
        }