//DbContext is the link between the database and my models. public static void Initialize(GameItemsContext dbContext) { SampleData sampleGameData = SampleDataGenerator.GenerateSampleGameData(); //All Games IList <Game> games = sampleGameData.games; //All Payloads IList <Comment> comments //What does a db context do? dbContext.Database.EnsureCreated(); if (dbContext.Games.Any()) { return; //Test data has already been added. } //dbContext.Games.Add(sampleGameData); //dbContext.SaveChanges(); }
public GameRetrieval(GameItemsContext _gameItemsContext) { gameItemsContext = _gameItemsContext; }