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