Constructor UseCaseAsyncCommand
- Namespace
- Ploch.CommandLine.UseCases
- Assembly
- Ploch.CommandLine.UseCases.dll
UseCaseAsyncCommand(IOutput, TUseCase, CommandArgumentsRootProcessor, ICommandSettingsValidator<TCommandSettings>, IExceptionHandler)
Base class for asynchronous commands that delegate their work to a use case and render its result.
protected UseCaseAsyncCommand(IOutput output, TUseCase useCase, CommandArgumentsRootProcessor settingsProcessor, ICommandSettingsValidator<TCommandSettings> validator, IExceptionHandler exceptionHandler)
Parameters
outputIOutputThe output writer used to render progress and results.
useCaseTUseCaseThe use case executed by this command.
settingsProcessorCommandArgumentsRootProcessorThe processor applied to the command settings before execution.
validatorICommandSettingsValidator<TCommandSettings>The validator used to validate the command settings.
exceptionHandlerIExceptionHandlerThe handler used to process exceptions raised during execution.
Remarks
The four type parameters are deliberate. TCommandSettings is required by the
AsyncAppCommand<TSettings> base class. TUseCase keeps the concrete use
case type, so a derived command can reach members beyond IResultUseCase<TRequest, TResponse>.
C# cannot infer TUseCaseRequest and TUseCaseResponse from
TUseCase, so they must be stated to constrain it and to type the request and the
rendered result.