Ejemplo n.º 1
0
        public ActionResult <CommandReadDto> GetCommandByID(int id)
        {
            var commndItem = _repository.GetCommandByID(id);

            if (commndItem != null)
            {
                return(Ok(_mapper.Map <CommandReadDto>(commndItem)));
            }
            return(NotFound());
        }
Ejemplo n.º 2
0
        public ActionResult <CommandReadDto> GetCommandByID(int id)
        {
            var commandItem = _repository.GetCommandByID(id);

            if (commandItem != null)
            {
                // return Ok(commandItem); //Old implementation, direct model return
                return(Ok(_mapper.Map <CommandReadDto>(commandItem)));
            }
            return(NotFound());
        }
        public ActionResult <Command> GetCommandByID(int id)
        {
            // https://docs.microsoft.com/en-us/aspnet/core/mvc/models/model-binding?view=aspnetcore-3.1
            var commandItems = _repository.GetCommandByID(id);

            return(Ok(commandItems));
        }
Ejemplo n.º 4
0
        public ActionResult <Command> GetCommandById(Guid id)
        {
            var commandItem = _repository.GetCommandByID(id);

            return(Ok(commandItem));
        }