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()); }
public ActionResult GetCommand(int id) { var cmd = _commandRepository.GetCommandAsync(id); return(Ok(cmd)); }