public async Task <IEnumerable <CommandReadDto> > Handle(GetAllCommandsQuery request, CancellationToken cancellationToken) { var commandItems = _repository.GetAllCommands(); return(_mapper.Map <IEnumerable <CommandReadDto> >(commandItems)); }
public async Task <ActionResult> GetAll([FromQuery] GetAllCommandsQuery getAllCommandsQuery) { var result = await _mediator.Send(getAllCommandsQuery); return(Ok(result)); }