Ejemplo n.º 1
0
        //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();
        }
Ejemplo n.º 2
0
 public GameRetrieval(GameItemsContext _gameItemsContext)
 {
     gameItemsContext = _gameItemsContext;
 }