public async Task <ActionResult <IEnumerable <CommandReadDto> > > GetAllCommands() { IEnumerable <Command> commands = await _repository.GetAllCommands(); if (commands.Count() < 1) { return(NotFound()); } return(Ok(_mapper.Map <IEnumerable <CommandReadDto> >(commands))); }
public ActionResult <IEnumerable <CommandReadDto> > GetAllCommands() { try { var commands = _repository.GetAllCommands(); return(Ok(_mapper.Map <IEnumerable <CommandReadDto> >(commands))); } catch (Exception) { return(NotFound()); } }
public ActionResult <IEnumerable <CommandReadDto> > GetAllCommands() { var commands = _repository.GetAllCommands(); return(Ok(_mapper.Map <IEnumerable <CommandReadDto> >(commands))); }
public ActionResult <IEnumerable <CommandReadDto> > GetAllCommands() { var commandItems = _repository.GetAllCommands(); return(Ok(_mapper.Map <IEnumerable <CommandReadDto> >(commandItems))); // 200 success in postman }
public ActionResult <IEnumerable <CommandReadDto> > GetAppCommands() { var items = _commandRepo.GetAllCommands(); return(Ok(_mapper.Map <IEnumerable <CommandReadDto> >(items))); }
public IActionResult Index() { return(View(new IndexViewModel { commands = _repo.GetAllCommands() })); }
public ActionResult <IEnumerable <CommandDtoRead> > GetAllCommands() { var commandItems = _repo.GetAllCommands(); return(Ok(_mapper.Map <IEnumerable <CommandDtoRead> >(commandItems))); }