public IActionResult Update(int id, SuperPowersList newSuperPowersList) { var superPowersList = _context.superPowersLists.Find(id); if (superPowersList == null) { return(NotFound()); } superPowersList.parentId = newSuperPowersList.parentId; superPowersList.superPowerId = newSuperPowersList.superPowerId; _context.superPowersLists.Update(superPowersList); _context.SaveChanges(); return(NoContent()); }
public IActionResult Post([FromBody] SuperPowersList superPowersList) { _context.superPowersLists.Add(superPowersList); _context.SaveChanges(); return(CreatedAtRoute("GetSuperPowersListById", new { id = superPowersList.id }, superPowersList)); }