public ResultAddRegularUser AddRegularUser(SigninMeetupModel model, int?meetupIdToRegister, UserManager <MyMeetupUser> userManager) { ResultAddRegularUser rau = new ResultAddRegularUser(); MyMeetupUser newUser = MyMeetupUser.From(model); rau.UserId = MyMeetupUser.CreateUser(newUser, MyMeetupRole.Participant, newUser.Initials + DateTime.Now.ToString("HHmmss"), userManager); if (rau.UserOk && meetupIdToRegister.HasValue) { rau.RegistrationCode = Register(newUser, meetupIdToRegister.Value).RegistrationCode; } return(rau); }
public static void SeedUsers(UserManager <MyMeetupUser> userManager) { if (userManager.FindByNameAsync("admin").Result == null) { var user = new MyMeetupUser { UserName = "******", Email = "*****@*****.**", FirstName = "test", LastName = "test2", LockoutEnabled = false }; string pwd = $"admin{DateTime.Now:yyMMdd}"; MyMeetupUser.CreateUser(user, MyMeetupRole.Administrateur, pwd, userManager); } }