public IActionResult Index() { var games = NflGame.GetGames("11"); //List<NflGame> gameList = new List<NflGame>(); //foreach (var game in games) //{ // gameList.Add(game); //} return(View(games)); }
public async Task <IActionResult> UpdateGames() { _context.Database.ExecuteSqlCommand("TRUNCATE TABLE [NflGames]"); var games = NflGame.GetGames("5"); foreach (var game in games) { _context.NflGames.Add(game); } await _context.SaveChangesAsync(); return(RedirectToAction("Index", "Home")); }