public async Task <IActionResult> Index() { string apiKey = _config.GetSection("ApiKeys").GetSection("LocationApiKey").Value.ToString(); string connString = _config.GetSection("DbConnection").GetSection("ConnectionString").Value.ToString(); bool DbState = _locationService.CheckDb(connString); bool ApiState = await _locationService.CheckApi(apiKey); if (ApiState == true) { var viewModel = await _locationService.GetStart(apiKey); viewModel.ApiOk = ApiState; viewModel.DbOk = DbState; if (viewModel.DbOk == true) { viewModel.list = _locationService.GetList(connString); } return(View(viewModel)); } else { return(null); } }