Interface IAuditableQueryFactory<TListQuery, TListRequestDto, TListResponse, TViewQuery, TViewResponse>
Represents a query factory for Auditable Requests. The command is the message that will be pumped into the CQRS architecture, it is not running any logic itself. The reason for having a factory is so you can push this into the controller without it having any knowledge of how the commands generate or operate.
public interface IAuditableQueryFactory<TListQuery, in TListRequestDto, TListResponse, TViewQuery, TViewResponse> where TListQuery : IAuditableRequest<in TListRequestDto, TListResponse> where TViewQuery : IAuditableRequest<long, TViewResponse?>
Type Parameters
TListQuery
The type of the List query.
TListRequestDto
The type of the Request DTO for the List Query.
TListResponse
The type of the Response DTO for the List Query.
TViewQuery
The type of the View query.
TViewResponse
The type of the Response DTO for the View Query.
Methods
GetListQueryAsync(TListRequestDto, ClaimsPrincipal, CancellationToken)
Gets the auditable Query for use in a List Operation.
Task<TListQuery> GetListQueryAsync(TListRequestDto requestDto, ClaimsPrincipal claimsPrincipal, CancellationToken cancellationToken)
Parameters
requestDto
TListRequestDtoThe Request DTO for the List Query.
claimsPrincipal
ClaimsPrincipalThe Claims principal attached to the request.
cancellationToken
CancellationTokenThe cancellation token.
Returns
- Task<TListQuery>
A Task<TResult> representing the result of the asynchronous operation.
GetViewQueryAsync(long, ClaimsPrincipal, CancellationToken)
Gets the auditable Query for use in a View Operation.
Task<TViewQuery> GetViewQueryAsync(long id, ClaimsPrincipal claimsPrincipal, CancellationToken cancellationToken)
Parameters
id
longThe unique id for the view query.
claimsPrincipal
ClaimsPrincipalThe Claims principal attached to the request.
cancellationToken
CancellationTokenThe cancellation token.
Returns
- Task<TViewQuery>
A Task<TResult> representing the result of the asynchronous operation.