Пример #1
0
        public async Task <ActionResult> Index()
        {
            try
            {
                _logger.LogDebug("Rendering the Index View");
                List <Customer> wf = null;
                ViewBag.Comment = _config["Welcome"];
                var response = await WebCall.GetApiDataAsync(_config["BackendServer"], "api/customers/");

                if (response != null)
                {
                    string responseString = await response.Content.ReadAsStringAsync();

                    wf = JsonConvert.DeserializeObject <List <Customer> >(responseString);
                }
                return(View(wf));
            }
            catch (Exception ex)
            {
                _logger.LogError(ex.ToString());
                throw ex;
            }
        }