Exemplo n.º 1
0
        public ActionResult DeleteMove([FromRoute] string id, [FromBody] object moveName)
        {
            PokemonDTO pkmnFound = service.GetByID(id);

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

            JsonElement element   = (JsonElement)moveName;
            string      json      = element.GetProperty("move_name").ToString();
            MovesDTO    moveFound = service.GetByName(json);

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

            service.DeleteMove(json, id);
            return(NoContent());
        }