Esempio n. 1
0
        public Task UpdateAsync(IdentityUser user)
        {
            if (user == null)
            {
                throw new ArgumentException("user");
            }

            var u = _userApplicationService.GetById(user.Id);

            if (u == null)
            {
                throw new ArgumentException("IdentityUser does not correspond to a User entity.", "user");
            }

            var userEditViewModel = new UserEditViewModel()
            {
                Id            = u.Id,
                Email         = u.Email,
                PasswordHash  = u.PasswordHash,
                SecurityStamp = u.SecurityStamp,
                UserName      = u.UserName
            };

            _userApplicationService.Edit(userEditViewModel);
            return(_unitOfWork.SaveChangesAsync());
        }