public async Task <IEnumerable <CommandReadDto> > Handle(GetAllCommandsQuery request, CancellationToken cancellationToken)
        {
            var commandItems = _repository.GetAllCommands();

            return(_mapper.Map <IEnumerable <CommandReadDto> >(commandItems));
        }
示例#2
0
        public async Task <ActionResult> GetAll([FromQuery] GetAllCommandsQuery getAllCommandsQuery)
        {
            var result = await _mediator.Send(getAllCommandsQuery);

            return(Ok(result));
        }