public ActionResult Index() { var msg = "No Db Connection"; var tableList = string.Empty; ViewBag.Message = "Your application home page."; try { var db = new DataContext(ConfigurationManager.ConnectionStrings["dockerdb"].ConnectionString); var textRepo = new ListsRepo(db); var returnText = textRepo.GetCount(); msg = "Db Connection OK"; } catch (Exception e) { msg = e.Message; } var vm = new TextViewModel { Description = msg }; return(View(vm)); }