public async Task <IActionResult> Edit(int id, [Bind("Id,LakeSystemId,NameKK,NameRU,NameEN")] LakeSystem lakeSystem) { if (id != lakeSystem.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(lakeSystem); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LakeSystemExists(lakeSystem.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(lakeSystem)); }
public async Task <IActionResult> Create([Bind("Id,LakeSystemId,NameKK,NameRU,NameEN")] LakeSystem lakeSystem) { if (ModelState.IsValid) { _context.Add(lakeSystem); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(lakeSystem)); }