示例#1
0
        public Task <IdentityResult> UpdateAsync(ApplicationRole role, CancellationToken cancellationToken)
        {
            if (role == null)
            {
                throw new ArgumentNullException(nameof(role), "Parameter role is not set to an instance of an object.");
            }

            return(_rolesTable.UpdateAsync(role, cancellationToken));
        }
示例#2
0
        public override async Task <IdentityResult> UpdateAsync(IdentityRole <TKey> role, CancellationToken cancellationToken = default)
        {
            cancellationToken.ThrowIfCancellationRequested();
            ThrowIfDisposed();
            role.ThrowIfNull(nameof(role));

            role.ConcurrencyStamp = Guid.NewGuid().ToString();
            var updated = await RolesTable.UpdateAsync(role, RoleClaims);

            return(updated ? IdentityResult.Success : IdentityResult.Failed(
                       new IdentityError {
                Description = $"Role '{role.Name}' could not be updated."
            }
                       ));
        }
 public Task <IdentityResult> UpdateAsync(ApplicationRole role, CancellationToken cancellationToken)
 {
     cancellationToken.ThrowIfCancellationRequested();
     role.ThrowIfNull(nameof(role));
     return(_rolesTable.UpdateAsync(role));
 }