public AppUser(SpecialAppUsers user) { this.user = user; UnauthorisedUser = new UnautorisedUser(user); AuthorisedUser = new AuthorisedUser(user); this.currentState = new UnautorisedUser(user); }
public async Task <IdentityResult> UpdateAsync(SpecialAppUsers user) { if (user == null) { throw new ArgumentNullException("user"); } var result = await Service.UpdateAsync(user); return(result); }
public async Task <IdentityResult> CreateAsync(SpecialAppUsers users, string password) { var result = await UserManager.FindByEmailAsync(users.Email); if (result != null) { var busex = busExFunc(); busex.Add("EmailAddress", "Email address already exists"); busex.ThrowIfErrors(); } return(await UserManager.CreateAsync(users, password)); }
public async Task <Tuple <SpecialAppUsers, SpecialAppUsers> > CreateTestAsync() { var result = await Service.FindByEmailAsync("*****@*****.**"); var result2 = await Service.FindByEmailAsync("*****@*****.**"); var user = new SpecialAppUsers { Email = "*****@*****.**", UserName = "******", PhoneNumber = "0433277470" }; var user2 = new SpecialAppUsers { Email = "*****@*****.**", UserName = "******", PhoneNumber = "0430499210" }; if (result == null) { await Service.CreateAsync(user, "Cloudn@9"); } else { result.PhoneNumber = user.PhoneNumber; await Service.UpdateAsync(result); } if (result2 == null) { await Service.CreateAsync(user2, "Cloudn@9"); } else { result2.PhoneNumber = user2.PhoneNumber; await Service.UpdateAsync(result2); } result = await Service.FindByEmailAsync("*****@*****.**"); result2 = await Service.FindByEmailAsync("*****@*****.**"); return(new Tuple <SpecialAppUsers, SpecialAppUsers>(result, result2)); }
public AuthorisedUser(SpecialAppUsers user) { this.user = user; }
public async Task <IdentityResult> UpdateAsync(SpecialAppUsers users) { return(await UserManager.UpdateAsync(users)); }
public ITokenService GenerateToken(IConfigurationRoot config, SpecialAppUsers user, bool rememberMe = false) { CreateToken(config, user, rememberMe); return(this); }
public UnautorisedUser(SpecialAppUsers users) { this.users = users; }