Example #1
0
        public async Task <ActionResult <Command> > GetCommandByIdAsync(int id)
        {
            if (id <= 0)
            {
                return(BadRequest());
            }

            var command = await _commandRepository.GetCommandAsync(id);

            if (command != null)
            {
                return(Ok(command));
            }

            return(NotFound());
        }
Example #2
0
        public ActionResult GetCommand(int id)
        {
            var cmd = _commandRepository.GetCommandAsync(id);

            return(Ok(cmd));
        }