public async Task EnsureSeedData()
        {
            if (await _userManager.FindByEmailAsync("*****@*****.**") == null)
            {
                var user = new User()
                {
                    UserName     = "******",
                    Email        = "*****@*****.**",
                    SummonerName = "Briedrice"
                };
                await _userManager.CreateAsync(user, "P@ssw0rd!");
            }
            if (!_context.Person.Any())
            {
                var person = new Person()
                {
                    FName        = "John",
                    LName        = "Smith",
                    personId     = "e32d",
                    summonerName = "MNG"
                };
                _context.Person.Add(person);

                await _context.SaveChangesAsync();
            }
        }
示例#2
0
        public async Task EnsureSeedData()
        {
            if (!_context.Person.Any())
            {
                var person = new Person()
                {
                    FName        = "John",
                    LName        = "Smith",
                    personId     = "e32d",
                    summonerName = "briedrice"
                };
                _context.Person.Add(person);

                await _context.SaveChangesAsync();
            }
        }