public async Task <ActionResult <PreRegisteration> > PostPreRegisteration(PreRegisteration preRegisteration) { _context.PreRegisterations.Add(preRegisteration); await _context.SaveChangesAsync(); return(CreatedAtAction("GetPreRegisteration", new { id = preRegisteration.Id }, preRegisteration)); }
public async Task <IActionResult> PutPreRegisteration(int id, PreRegisteration preRegisteration) { if (id != preRegisteration.Id) { return(BadRequest()); } _context.Entry(preRegisteration).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PreRegisterationExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }