public async Task <IActionResult> PutUser(int id, ApplicationUser user) { if (id != user.Id) { return(BadRequest()); } _context.Entry(user).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UserExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutGuild(int id, Guild guild) { if (id != guild.Id) { return(BadRequest()); } _context.Entry(guild).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!GuildExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }