Interface IGrantRepository
- Namespace
- Excalibur.A3.Authorization.Grants
- Assembly
- Excalibur.A3.dll
Represents a repository for managing Grant entities.
public interface IGrantRepository : IEventSourcedRepository<Grant>, IEventSourcedRepository<Grant, string>
- Inherited Members
Remarks
Extends the Excalibur.EventSourcing event-sourced repository with Grant-specific query methods.
Methods
MatchingAsync(GrantScope, string?, CancellationToken)
Retrieves grants matching a specific GrantScope and optional user ID.
Task<IEnumerable<Grant>> MatchingAsync(GrantScope scope, string? userId, CancellationToken cancellationToken)
Parameters
scopeGrantScopeThe grant scope to filter results.
userIdstringOptional user ID to narrow the search.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<IEnumerable<Grant>>
An IEnumerable<T> of Grant matching the criteria.
Exceptions
- ArgumentNullException
Thrown if
scopeis null.- ArgumentException
Thrown if
userIdis null or empty.
ReadAllAsync(string, CancellationToken)
Reads all grants associated with a specific user.
Task<IEnumerable<Grant>> ReadAllAsync(string userId, CancellationToken cancellationToken)
Parameters
userIdstringThe user ID for which to retrieve grants.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<IEnumerable<Grant>>
An IEnumerable<T> of Grant for the user.
Exceptions
- ArgumentException
Thrown if
userIdis null or empty.