public async Task EnsureSeedDataAsync() { if (await _userManager.FindByEmailAsync("*****@*****.**") == null) { // Add the User. var user = new TaskUser() { UserName = "******", Email = "*****@*****.**", FirstQuest = DateTime.UtcNow }; await _userManager.CreateAsync(user, "Metal242$"); } if (!_context.Quests.Any()) { // Add new Data var beerQuest = new Quest() { Name = "Beer Run", DueBy = DateTime.UtcNow, Reward = "Lost of Beer!", Status = "Incomplete", UserName = "******" }; _context.Quests.Add(beerQuest); var laundryQuest = new Quest() { Name = "Do Laundry", DueBy = DateTime.UtcNow, Reward = "Game Time!", Status = "Complete", UserName = "******" }; _context.Quests.Add(laundryQuest); _context.SaveChanges(); } }
public async Task EnsureSeedDataAsync() { if (await _userManager.FindByEmailAsync("*****@*****.**") == null) { // Add the User. var user = new TaskUser() { UserName = "******", Email = "*****@*****.**", FirstQuest = DateTime.UtcNow }; await _userManager.CreateAsync(user, "Metal242$"); } if (!_context.Quests.Any()) { // Add new Data var beerQuest = new Quest() { Name = "Beer Run", DueBy = DateTime.UtcNow, Reward = "Lost of Beer!", Status = "Incomplete", UserName = "******" }; _context.Quests.Add(beerQuest); var laundryQuest = new Quest() { Name = "Do Laundry", DueBy = DateTime.UtcNow, Reward = "Game Time!", Status = "Complete", UserName = "******" }; _context.Quests.Add(laundryQuest); _context.SaveChanges(); } }