public async Task <bool> CreateUser(string userName, string password, string email, bool emailConfirmed = false) { var user = new IdentityUser { UserName = userName, Email = email, EmailConfirmed = emailConfirmed }; var result = await this.GetService <UserManager <IdentityUser> >().CreateAsync(user, password); if (!result.Succeeded) { return(false); } await Extras.AddAsync(new AppUser.ExtraInfo { ID = user.Id, RegisterTime = DateTime.Now }); return(true); }