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