Esempio n. 1
0
 public IActionResult AddSpell([FromBody] HPSpell newSpell)
 {
     //Boek toevoegen
     context.HPspell.Add(newSpell);
     context.SaveChanges();
     return(Created("", newSpell));
 }
Esempio n. 2
0
    public IActionResult UpdateSpell([FromBody] HPSpell UpdateSpell)
    {
        var oldSpell = context.HPspell.Find(UpdateSpell.Id);

        if (oldSpell == null)
        {
            return(NotFound());
        }
        oldSpell.Name   = UpdateSpell.Name;
        oldSpell.Effect = UpdateSpell.Effect;
        {
        }

        context.SaveChanges();
        return(Ok(oldSpell));
    }