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