Table of Contents

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

scope GrantScope

The grant scope to filter results.

userId string

Optional user ID to narrow the search.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<IEnumerable<Grant>>

An IEnumerable<T> of Grant matching the criteria.

Exceptions

ArgumentNullException

Thrown if scope is null.

ArgumentException

Thrown if userId is null or empty.

ReadAllAsync(string, CancellationToken)

Reads all grants associated with a specific user.

Task<IEnumerable<Grant>> ReadAllAsync(string userId, CancellationToken cancellationToken)

Parameters

userId string

The user ID for which to retrieve grants.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<IEnumerable<Grant>>

An IEnumerable<T> of Grant for the user.

Exceptions

ArgumentException

Thrown if userId is null or empty.