Esempio n. 1
0
        public async Task <APIResponse> GetAllVendorQuestionAnswersById(string Id, bool IsForVendor)
        {
            try
            {
                var client = httpClientFactory.CreateClient(VendorServiceOperation.serviceName);

                var response = await client.GetAsync(servicesConfig.Vendor + VendorServiceOperation.GetAllVendorQuestionAnswersById(Id, IsForVendor));

                if (response.IsSuccessStatusCode)
                {
                    var VendorQA = JsonConvert.DeserializeObject <List <VendorQuestionAnswerResponseDetails> >(await response.Content.ReadAsStringAsync());

                    return(new APIResponse(VendorQA, HttpStatusCode.OK));
                }

                return(new APIResponse(response.StatusCode));
            }
            catch (Exception ex)
            {
                logger.Error(ex, "Exception in method 'GetAllVendorQuestionAnswersById()'");
                var exMessage = ex.InnerException != null ? ex.InnerException.Message : ex.Message;
                return(new APIResponse(exMessage, HttpStatusCode.InternalServerError));
            }
        }