public async Task <IActionResult> Edit(int id, [Bind("EduLevelGroupId,EduLevelGroupName")] EduLevelGroup eduLevelGroup) { if (id != eduLevelGroup.EduLevelGroupId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(eduLevelGroup); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EduLevelGroupExists(eduLevelGroup.EduLevelGroupId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(eduLevelGroup)); }
public async Task <IActionResult> Create([Bind("EduLevelGroupId,EduLevelGroupName")] EduLevelGroup eduLevelGroup) { if (ModelState.IsValid) { _context.Add(eduLevelGroup); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(eduLevelGroup)); }