public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Desciption")] DictEduCategory dictEduCategory) { if (id != dictEduCategory.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(dictEduCategory); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ClUchZavedCategoryExists(dictEduCategory.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(dictEduCategory)); }
public async Task <IActionResult> Create([Bind("Id,Name,Desciption")] DictEduCategory dictEduCategory) { if (ModelState.IsValid) { _context.Add(dictEduCategory); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(dictEduCategory)); }