public async Task Initialize(IServiceCollection serviceCollection) { var userCount = await _userStore.Count(); if (userCount > 0) { return; } Console.WriteLine("Creating default user with configured password."); var user = new User { FirstName = "Anna", LastName = "Andersson", Email = "*****@*****.**", Created = DateTime.Now, Modified = DateTime.Now }; user = await _userStore.Save(user); var newUser = await _userStore.SetPassword(user.Id, "configured password"); if (newUser == null) { throw new Exception("Failed to create default user."); } }