public IActionResult Index() { if (HttpContext.Session.GetString("dbusername") == null || HttpContext.Session.GetString("dbusername") == "guest") { return(RedirectToAction("Index", "Home")); } model = new RaceModel(HttpContext.Session.GetString("dbusername"), HttpContext.Session.GetString("dbpassword")); ViewBag.Races = model.GetRaces(); ViewBag.RacesNoOwner = model.GetRacesNoOwner(); return(View()); }