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