[HttpGet]                                                            //which verb our action responds to
        public ActionResult <IEnumerable <CommandReadDto> > GetAllCommands() // GET Verb Attribute in combination with the route (e.g., api/commands) should be unique for each action (endpoint) within our API
        {
            IEnumerable <Command>        commands   = reposService.GetAllCommands();
            IEnumerable <CommandReadDto> commandDTO = mapper.Map <IEnumerable <CommandReadDto> >(commands); //use auto mapper to convert

            return(Ok(commandDTO));                                                                         // We return a HTTP 200 Result (OK) and pass back our result set.
        }
        public ActionResult <IEnumerable <CommandReadDto> > GetAllCommands()
        {
            var commandItems = _repository.GetAllCommands();
            var dtos         = _mapper.Map <IEnumerable <CommandReadDto> >(commandItems);

            return(Ok(dtos));
        }
        public ActionResult <IEnumerable <CommandReadDto> > GetAllCommands()
        {
            Debug.WriteLine("CommandsController::GetAllCommands()");
            var commandItems = _repository.GetAllCommands();

            return(Ok(_mapper.Map <IEnumerable <CommandReadDto> >(commandItems)));
        }
Exemple #4
0
        public ActionResult <IEnumerable <Command> > GetAllCommands()
        {
            //return new string[] {"this", "is", "hard", "coded"};

            var CommandItems = _repository.GetAllCommands();

            if (CommandItems == null)
            {
                return(NotFound());
            }

            return(Ok(CommandItems));
        }
Exemple #5
0
        public ActionResult <IEnumerable <Command> > GetAllCommands()
        {
            var commandItems = _repository.GetAllCommands();

            return(Ok(commandItems));
        }
 public ActionResult <IEnumerable <CommandReadDto> > GetAllCommands()
 {
     return(Ok(_mapper.Map <IEnumerable <CommandReadDto> >(_commandAPIRepo.GetAllCommands())));
 }
 public ActionResult <IEnumerable <string> > Get()
 {
     return(Ok(_repository.GetAllCommands()));
 }
Exemple #8
0
        public ActionResult <IEnumerable <CommandReadDto> > Get()
        {
            IEnumerable <Command> commandItems = _repository.GetAllCommands();

            return(Ok(_mapper.Map <IEnumerable <CommandReadDto> >(commandItems)));
        }
Exemple #9
0
        public ActionResult <IEnumerable <CommandReadDto> > GetAllCommands()
        {
            var commands = repository.GetAllCommands();

            return(Ok(mapper.Map <IEnumerable <CommandReadDto> >(commands)));
        }
Exemple #10
0
        public ActionResult <IEnumerable <Command> > GetAllCommands()
        {
            var commandItems = _commandAPIRepo.GetAllCommands();

            return(Ok(commandItems));
        }
Exemple #11
0
 public ActionResult <IEnumerable <CommandReadDto> > GetAllCommands() => Ok(_mapper.Map <IEnumerable <CommandReadDto> >(_repo.GetAllCommands()));
Exemple #12
0
        public async Task <ActionResult <IEnumerable <CommandReadDto> > > GetAllCommands()
        {
            IEnumerable <Command> commandsList = await Task.Run(() => _commandAPIRepo.GetAllCommands());

            return(Ok(_mapper.Map <IEnumerable <CommandReadDto> >(commandsList)));
        }
        [HttpGet] //reponds to GET verb
        public ActionResult <IEnumerable <Command> > GetAllCommands()
        {
            var commandItems = _repository.GetAllCommands();

            return(Ok(commandItems)); //Return a HTTP 200 Result (OK) and pass back our result set
        }