public async Task <IActionResult> Edit(int id, [Bind("NeklijnID,Naam")] Neklijn neklijn) { if (id != neklijn.NeklijnID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(neklijn); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!NeklijnExists(neklijn.NeklijnID)) { return(NotFound()); } else { throw; } } return(RedirectToAction("Index")); } return(View(neklijn)); }
public async Task <IActionResult> Create([Bind("NeklijnID,Naam")] Neklijn neklijn) { if (ModelState.IsValid) { _context.Add(neklijn); await _context.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(neklijn)); }