public static void CreateLocalAccount( IDocumentStore masterStore,string email,string password ,UserAccountService userAccountService) { if (userAccountService == null) return; var account=userAccountService.CreateAccount(null, password, email); account.RequiresPasswordReset = true; userAccountService.Update(account); }
private void InitDb() { using (var db = new BrockAllen.MembershipReboot.Ef.DefaultUserAccountRepository()) { var svc = new UserAccountService(db); if (svc.GetByUsername("admin") == null) { var account = svc.CreateAccount("admin", "admin123", "*****@*****.**"); svc.VerifyAccount(account.VerificationKey); account = svc.GetByID(account.ID); account.AddClaim(ClaimTypes.Role, "Administrator"); account.AddClaim(ClaimTypes.Role, "Manager"); account.AddClaim(ClaimTypes.Country, "USA"); svc.Update(account); } } }