Пример #1
0
        public async static Task Initialize(LeaderboardContext context)
        {
            context.Database.EnsureCreated();
            if (context.Gamers.Any())
            {
                return;
            }
            var gamer = context.Gamers.Add(new Gamer()
            {
                GamerGuid = Guid.NewGuid(), Nickname = "LX360", Scores = new List <Score>()
                {
                    new Score()
                    {
                        Points = 1337, Game = "Pacman"
                    }
                }
            });

            context.Gamers.Add(new Gamer()
            {
                GamerGuid = Guid.NewGuid(), Nickname = "Kn3luZ"
            });
            context.Gamers.Add(new Gamer()
            {
                GamerGuid = Guid.NewGuid(), Nickname = "BeyondDotNET"
            });
            await context.SaveChangesAsync();
        }
Пример #2
0
 public async static Task Initialize(LeaderboardContext context)
 {
     context.Database.EnsureCreated();
     if (context.Gamers.Any())
     {
         return;
     }
     context.Gamers.Add(new Gamer()
     {
         GamerGuid = Guid.NewGuid(), Nickname = "LX360"
     });
     context.Gamers.Add(new Gamer()
     {
         GamerGuid = Guid.NewGuid(), Nickname = "Kn3luZ"
     });
     context.Gamers.Add(new Gamer()
     {
         GamerGuid = Guid.NewGuid(), Nickname = "BeyondDotNET"
     });
     await context.SaveChangesAsync();
 }