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

            //return Ok(allCommands);
            return(new string[] { "value1", "value2" });
        }
Exemplo 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));
        }
Exemplo n.º 3
0
        public ActionResult <IEnumerable <Command> > GetAllCommands()
        {
            var commandItems = _repository.GetAllCommands();

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

            return(Ok(commandItems));
        }