Table of Contents

Interface IAuditableCommandFactory<TAddCommand, TAddRequestDto, TAddResponseDto, TDeleteCommand, TDeleteResponseDto, TUpdateCommand, TUpdateRequestDto, TUpdateResponseDto>

Namespace
Whipstaff.MediatR
Assembly
Whipstaff.MediatR.dll

Represents a command factory for auditable Requests. The command is the message that will be pumped into the CQRS architecture, it is not running any logic itself.

public interface IAuditableCommandFactory<TAddCommand, in TAddRequestDto, TAddResponseDto, TDeleteCommand, TDeleteResponseDto, TUpdateCommand, in TUpdateRequestDto, TUpdateResponseDto> where TAddCommand : IAuditableRequest<in TAddRequestDto, TAddResponseDto?> where TDeleteCommand : IAuditableRequest<long, TDeleteResponseDto?> where TUpdateCommand : IAuditableRequest<in TUpdateRequestDto, TUpdateResponseDto?>

Type Parameters

TAddCommand

The type of the Add command.

TAddRequestDto

The type of the Request DTO for the Add Command.

TAddResponseDto

The type of the Response DTO for the Add Command.

TDeleteCommand

The type of the Delete command.

TDeleteResponseDto

The type of the Response DTO for the Delete Command.

TUpdateCommand

The type of the Update command.

TUpdateRequestDto

The type of the Request DTO for the Update Command.

TUpdateResponseDto

The type of the Response DTO for the Update Command.

Methods

GetAddCommandAsync(TAddRequestDto, ClaimsPrincipal, CancellationToken)

Gets the auditable Command for use in an Add Operation.

Task<TAddCommand> GetAddCommandAsync(TAddRequestDto requestDto, ClaimsPrincipal claimsPrincipal, CancellationToken cancellationToken)

Parameters

requestDto TAddRequestDto

The Request DTO for the Add Command.

claimsPrincipal ClaimsPrincipal

The Claims principal attached to the request.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<TAddCommand>

A Task<TResult> representing the result of the asynchronous operation.

GetDeleteCommandAsync(long, ClaimsPrincipal, CancellationToken)

Gets the auditable Command for use in an Delete Operation.

Task<TDeleteCommand> GetDeleteCommandAsync(long id, ClaimsPrincipal claimsPrincipal, CancellationToken cancellationToken)

Parameters

id long

The unique id of the object for the Delete Command.

claimsPrincipal ClaimsPrincipal

The Claims principal attached to the request.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<TDeleteCommand>

A Task<TResult> representing the result of the asynchronous operation.

GetUpdateCommandAsync(TUpdateRequestDto, ClaimsPrincipal, CancellationToken)

Gets the auditable Command for use in an Update Operation.

Task<TUpdateCommand> GetUpdateCommandAsync(TUpdateRequestDto requestDto, ClaimsPrincipal claimsPrincipal, CancellationToken cancellationToken)

Parameters

requestDto TUpdateRequestDto

The Request DTO for the Update Command.

claimsPrincipal ClaimsPrincipal

The Claims principal attached to the request.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<TUpdateCommand>

A Task<TResult> representing the result of the asynchronous operation.