public async Task <IActionResult> Edit(int id, [Bind("Id,DateCollection,TempOutside,TempIndoor,HumOutside,HumIndoor")] WeatherRecords weatherRecords) { if (id != weatherRecords.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(weatherRecords); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!WeatherRecordsExists(weatherRecords.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(weatherRecords)); }