public async Task <IActionResult> PostGeintereseerdAssignment([FromBody] GeintereseerdAssignment geintereseerdAssignment) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.GeintereseerdAssignment.Add(geintereseerdAssignment); await _context.SaveChangesAsync(); return(CreatedAtAction("GetGeintereseerdAssignment", new { id = geintereseerdAssignment.GeintereseerdAssignmentID }, geintereseerdAssignment)); }
public async Task <IActionResult> PutGeintereseerdAssignment([FromRoute] long id, [FromBody] GeintereseerdAssignment geintereseerdAssignment) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != geintereseerdAssignment.GeintereseerdAssignmentID) { return(BadRequest()); } _context.Entry(geintereseerdAssignment).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!GeintereseerdAssignmentExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }