public async Task <IActionResult> PutPasswordResets(int id, PasswordResets passwordResets) { if (id != passwordResets.ResetId) { return(BadRequest()); } _context.Entry(passwordResets).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PasswordResetsExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutDailyFitness(int id, DailyFitness dailyFitness) { if (id != dailyFitness.FitnessId) { return(BadRequest()); } _context.Entry(dailyFitness).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DailyFitnessExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutFriendships(int id, Friendships friendships) { if (id != friendships.FriendshipId) { return(BadRequest()); } _context.Entry(friendships).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!FriendshipsExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutUsers(int id, Users users) { if (id != users.UserId) { return(BadRequest()); } _context.Entry(users).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UsersExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutSleep(int id, Sleep sleep) { if (id != sleep.SleepId) { return(BadRequest()); } _context.Entry(sleep).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SleepExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }