public HttpResponseMessage GetByName(string pokemonName) { Pokemon pokemon = pokedexService.GetByName(pokemonName); if (!ModelState.IsValid) { return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState)); } return(Request.CreateResponse(HttpStatusCode.OK, pokemon)); }
public BaseResponse <List <PokemonModelDTO> > GetByName([FromQuery] string name) { return(ExecuteRequest(_pokedexService.GetByName(name))); }