public async Task <ActionResult <PollOptie> > PostPollOptie(PollOptie pollOptie) { _context.PollOpties.Add(pollOptie); await _context.SaveChangesAsync(); return(CreatedAtAction("GetPollOptie", new { id = pollOptie.PollOptieID }, pollOptie)); }
public async Task <IActionResult> PutPollOptie(long id, PollOptie pollOptie) { if (id != pollOptie.PollOptieID) { return(BadRequest()); } _context.Entry(pollOptie).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PollOptieExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }