Beispiel #1
0
        public async Task <IdentityResult> UpdateAsync(EasyUser user, CancellationToken cancellationToken)
        {
            var storedUser = await FindByIdAsync(user.Id, cancellationToken);

            storedUser.Name           = user.Name;
            storedUser.NormalizedName = user.NormalizedName;
            storedUser.PasswordHash   = user.PasswordHash;
            dbContext.Users.Update(storedUser);
            var updates = await dbContext.SaveChangesAsync();

            if (updates > 0)
            {
                return(IdentityResult.Success);
            }
            var des = new AmbsenyIdentityErrorDescriber();

            return(IdentityResult.Failed(des.UnableToPersistNewUser(user.NormalizedName)));
        }
Beispiel #2
0
 public EasyUserStore(EasyUserDbContext dbContext, AmbsenyIdentityErrorDescriber errorDescriber)
 {
     this.dbContext      = dbContext;
     this.errorDescriber = errorDescriber;
 }