Exemplo n.º 1
0
        public async Task <IActionResult> Index(ERequestType requestType)
        {
            var response = await _targetService.CallTargetService(requestType);

            var responseContent = JsonSerializer.Deserialize <ResponseModel>(response.Content.ReadAsStringAsync().Result,
                                                                             new JsonSerializerOptions()
            {
                PropertyNameCaseInsensitive = true
            });

            if (response.StatusCode == HttpStatusCode.OK)
            {
                return(Ok(responseContent));
            }

            return(BadRequest(responseContent));
        }