public async Task <IActionResult> Edit(int id, [Bind("Id,Identifier,Timestamp,Date,TemperatureC")] WeatherModel weatherModel) { if (id != weatherModel.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(weatherModel); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!WeatherModelExists(weatherModel.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(weatherModel)); }