public async Task <IActionResult> PutUser(long id, User user) { if (id != user.UserId) { 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> PutWheatherDato(int id, WheatherDato wheatherDato) { if (id != wheatherDato.WheatherDatoID) { return(BadRequest()); } _context.Entry(wheatherDato).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!WheatherDatoExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }