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