Ejemplo n.º 1
0
        /// <summary>
        /// Return all the available data from the ECAD for the supplied ECAD Id as an asynchronous operation.
        /// </summary>
        /// <param name="link">A link returned in a GetEcadData response.</param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        public async Task <Model.GetEcadData.Response> GetEcadDataAsync(Model.GetEcadData.Link link)
        {
            if (link == null)
            {
                throw new ArgumentNullException(nameof(link));
            }

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

            return(response);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Return all the available data from the ECAD for the supplied ECAD Id.
        /// </summary>
        /// <param name="link">A link returned in a GetEcadData response.</param>
        /// <returns>GetEcadData response.</returns>
        public Model.GetEcadData.Response GetEcadData(Model.GetEcadData.Link link)
        {
            try
            {
                return(GetEcadDataAsync(link).Result);
            }
            catch (Exception e)
            {
                if (e.InnerException != null)
                {
                    throw e.InnerException;
                }

                throw;
            }
        }