Exemplo n.º 1
0
        public ActionResult Post([FromBody] PokemonDTO pokemon)
        {
            PokemonDTO found = service.GetByID(pokemon.ID);

            if (found != null)
            {
                return(Conflict("Duplicate entry."));
            }
            service.Add(pokemon);
            return(Ok(pokemon));
        }
Exemplo n.º 2
0
 public void Post(string name, string type)
 {
     _service.Add(name, type);
 }