コード例 #1
0
        public ActionResult <PokemonTypeDTO> Get(string name)
        {
            var data = _repository.Get(name);

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

            return(Ok(DTOHelper.GetPokemonTypeDTO(data)));
        }
コード例 #2
0
        public ActionResult <IEnumerable <PokemonTypeDTO> > GetAll()
        {
            var data = _repository.Get();

            return(Ok(data.Select(x => DTOHelper.GetPokemonTypeDTO(x))));
        }