public IActionResult AddSpell([FromBody] HPSpell newSpell) { //Boek toevoegen context.HPspell.Add(newSpell); context.SaveChanges(); return(Created("", newSpell)); }
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)); }