コード例 #1
0
        public ActionResult <IEnumerable <string> > GetAllCommands()
        {
            var allCommands = _repository.GetAllCommands();

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

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

            return(Ok(commandItems));
        }