Exemple #1
0
        /// <summary>
        /// Return data for the supplied UK address ID as an asynchronous operation.
        /// </summary>
        /// <param name="request">GetGbBuildingData request.</param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        public async Task <Model.GetGbBuildingData.Response> GetGbBuildingDataAsync(Model.GetGbBuildingData.Request request)
        {
            if (request == null)
            {
                throw new ArgumentNullException(nameof(request));
            }

            Uri requestUri = GetRequestUri(_licenceKey, request.Txn, _autoaddressConfig.ApiBaseAddress, Version, GetGbBuildingDataMethod, request);
            var response   = await GetResponseAsync <Model.GetGbBuildingData.Response>(request, requestUri);

            return(response);
        }
Exemple #2
0
        /// <summary>
        /// Return data for the supplied UK address ID.
        /// </summary>
        /// <param name="request">GetGbBuildingData request.</param>
        /// <returns>GetGbBuildingData response.</returns>
        public Model.GetGbBuildingData.Response GetGbBuildingData(Model.GetGbBuildingData.Request request)
        {
            try
            {
                return(GetGbBuildingDataAsync(request).Result);
            }
            catch (Exception e)
            {
                if (e.InnerException != null)
                {
                    throw e.InnerException;
                }

                throw;
            }
        }