public async Task <ActionResult <ConsultaMatricula> > PostConsultaMatricula(ConsultaMatricula consultaMatricula) { _context.ConsultaMatricula.Add(consultaMatricula); await _context.SaveChangesAsync(); return(CreatedAtAction("GetConsultaMatricula", new { id = consultaMatricula.ConsultaMatriculaId }, consultaMatricula)); }
public async Task <IActionResult> PutConsultaMatricula(int id, ConsultaMatricula consultaMatricula) { if (id != consultaMatricula.ConsultaMatriculaId) { return(BadRequest()); } _context.Entry(consultaMatricula).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ConsultaMatriculaExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }