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