Exemplo n.º 1
0
        public async Task UpdatePasswordAsync(Guid userId, string password, CancellationToken cancellationToken = default)
        {
            if (string.IsNullOrEmpty(password))
            {
                throw new ArgumentNullException(nameof(password));
            }

            var user = await GetAsync(userId);

            toolShedContext.UserSet
            .Attach(user);
            toolShedContext.Entry(user).Property(c => c.Password).IsModified = true;
            await toolShedContext.SaveChangesAsync(cancellationToken);
        }