Esempio n. 1
0
        public ActionResult <IEnumerable <string> > GetAllCommands()
        {
            var allCommands = _repository.GetAllCommands();

            //return Ok(allCommands);
            return(new string[] { "value1", "value2" });
        }
Esempio n. 2
0
        public ActionResult <IEnumerable <CommandReadDto> > GetAllCommands()
        {
            // var commandItems = repository.GetAllCommands();

            var mockRepo     = new MockCommanderRepo();
            var commandItems = mockRepo.GetAllCommands();

            var commandReadDtos = mapper.Map <IEnumerable <CommandReadDto> >(commandItems);

            return(Ok(commandReadDtos));
        }
Esempio n. 3
0
        public ActionResult <IEnumerable <Command> > GetAllCommands()
        {
            var commandItems = _repository.GetAllCommands();

            return(Ok(_mapper.Map <IEnumerable <CommandReadDto> >(commandItems)));
        }
Esempio n. 4
0
        [HttpGet] // GET /api/commands
        public ActionResult <IEnumerable <Command> > GetAllCommands()
        {
            var commandItems = _repository.GetAllCommands();

            return(Ok(commandItems));
        }