public async Task <ActionResult <CisStudent> > PostCisStudent(CisStudent cisStudent) { _context.CisStudent.Add(cisStudent); await _context.SaveChangesAsync(); return(CreatedAtAction("GetCisStudent", new { id = cisStudent.Id }, cisStudent)); }
public async Task <IActionResult> PutCisStudent(int id, CisStudent cisStudent) { if (id != cisStudent.Id) { return(BadRequest()); } _context.Entry(cisStudent).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CisStudentExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }