public async Task <IActionResult> PutVillains(int id, Villains villains) { if (id != villains.VillainId) { return(BadRequest()); } _context.Entry(villains).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!VillainsExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutHeroes(int id, Heroes heroes) { if (id != heroes.HeroId) { return(BadRequest()); } _context.Entry(heroes).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!HeroesExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }