public LoggingAsyncActionHandlerDecorator( IActionHandlerAsync <TCommand> decorateeHandler, IEventLogger <LoggingAsyncActionHandlerDecorator <TCommand> > logger ) : base(decorateeHandler, logger, true) { this.decorateeHandler = decorateeHandler; }
private static Task ExecuteActionShimAsync <TAction>( IActionHandlerAsync <TAction> handler, TAction action ) where TAction : IAction { return(handler.ExecuteAsync(action)); }
public SpellController(IActionHandlerAsync <AddSpellCommand> addSpellActionHandler, IActionHandlerAsync <GetSpellCommand> getSpellActionHandler, IActionHandlerAsync <DeleteSpellCommand> deleteSpellActionHandler, IActionHandlerAsync <GetSpellsForLocationCommand> getSpellsForLocationActionHandler, IActionHandlerAsync <GetPagedSpellsCommand> getPagedSpellActionHandler) { AddSpellActionHandler = addSpellActionHandler; GetSpellActionHandler = getSpellActionHandler; DeleteSpellActionHandler = deleteSpellActionHandler; GetSpellsForLocationActionHandler = getSpellsForLocationActionHandler; GetPagedSpellActionHandler = getPagedSpellActionHandler; }
public UserController( IActionHandlerAsync <AddUserCommand> addUserActionHandler, IActionHandlerAsync <GetUserCommand> getUserActionHandler, IActionHandlerAsync <DeleteUserCommand> deleteUserActionHandler, IActionHandlerAsync <GetPagedUsersCommand> getPagedUsersHandler ) { AddUserHandler = addUserActionHandler; GetUserHandler = getUserActionHandler; DeleteUserHandler = deleteUserActionHandler; GetPagedUsersHandler = getPagedUsersHandler; }
public AuthenticationController(IActionHandlerAsync <LoginCommand> loginActionHandler) => LoginActionHandler = loginActionHandler;
public WeatherController(IActionHandlerAsync <GetCurrentWeatherCommand> getCurrentWeatherActionHandler) => GetCurrentWeatherActionHandler = getCurrentWeatherActionHandler;
public CharacterController(IActionHandlerAsync <GetCharacterCommand> getCharacterActionHandler) => GetCharacterActionHandler = getCharacterActionHandler;
public async Task <IActionResult> DeleteCheese(int cheeseId, [FromServices] IActionHandlerAsync <DeleteCheeseRequest, DeleteCheeseResponse> actionHandler, CancellationToken cancellationToken) { var result = await actionHandler.ProcessAsync(new DeleteCheeseRequest { Id = cheeseId }, cancellationToken); return(Ok(result)); }
public async Task <IActionResult> CreateCheese([FromBody] CreateCheeseRequest request, [FromServices] IActionHandlerAsync <CreateCheeseRequest, CreateCheeseResponse> actionHandler, CancellationToken cancellationToken) { if (!ModelState.IsValid) { return(new BadRequestObjectResult(ModelState)); } var result = await actionHandler.ProcessAsync(request, cancellationToken); return(Ok(result)); }
public async Task <IActionResult> GetCheese([FromServices] IActionHandlerAsync <GetCheeseRequest, IEnumerable <GetCheeseResponse> > actionHandler, CancellationToken cancellationToken) { var result = await actionHandler.ProcessAsync(new GetCheeseRequest {}, cancellationToken); return(Ok(result)); }