public Task <IdentityResult> CreateAsync(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.CreateAsync(role, cancellationToken)); }
public override async Task <IdentityResult> CreateAsync(IdentityRole <TKey> role, CancellationToken cancellationToken = default) { cancellationToken.ThrowIfCancellationRequested(); ThrowIfDisposed(); role.ThrowIfNull(nameof(role)); var created = await RolesTable.CreateAsync(role); return(created ? IdentityResult.Success : IdentityResult.Failed(new IdentityError { Description = $"Role '{role.Name}' could not be created." })); }
public Task <IdentityResult> CreateAsync(ApplicationRole role, CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); role.ThrowIfNull(nameof(role)); return(_rolesTable.CreateAsync(role)); }