public IActionResult OnDetail(string name) { Favorite favorite = new Favorite(HttpContext.Session); OlyCountry olyCountry = Context.OlyCountries.Include(t => t.OlySport).Include(t => t.OlyCat).Include(t => t.OlyGame).SingleOrDefault(t => t.OlyCountryName.ToLower() == name.ToLower()); Detail model = new Detail() { OlyCountry = olyCountry, Favorite = favorite.FavoriteValid(olyCountry), FavoriteList = favorite.AddFavorite() }; return(View(model)); }