public async Task<IActionResult> Edit(int id, [Bind("Id,LakeId,Year,Value")] SurfaceFlow surfaceFlow) { if (id != surfaceFlow.Id) { return NotFound(); } if (ModelState.IsValid) { try { _context.Update(surfaceFlow); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SurfaceFlowExists(surfaceFlow.Id)) { return NotFound(); } else { throw; } } return RedirectToAction(nameof(Index)); } return View(surfaceFlow); }
public async Task<IActionResult> Create([Bind("Id,LakeId,Year,Value")] SurfaceFlow surfaceFlow) { if (ModelState.IsValid) { _context.Add(surfaceFlow); await _context.SaveChangesAsync(); return RedirectToAction(nameof(Index)); } return View(surfaceFlow); }