Пример #1
0
        public async Task <IActionResult> GetCodeContext(string specificationId)
        {
            Guard.IsNullOrWhiteSpace(specificationId, nameof(specificationId));

            ApiResponse <IEnumerable <TypeInformation> > response = await _calcClient.GetCodeContextForSpecification(specificationId);

            if (response.StatusCode == HttpStatusCode.OK)
            {
                return(Ok(response.Content));
            }
            else
            {
                throw new InvalidOperationException($"An error occurred while retrieving code context. Status code={response.StatusCode}");
            }
        }