public async Task <IHttpActionResult> EditPassword(int userID, string oldPassword, string newPassword) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var user = await db.Users.FirstOrDefaultAsync((u) => u.UserID == userID); if (user == null) { return(NotFound()); } await db.EditUserPassword(userID, oldPassword, newPassword); return(Ok()); }