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