Esempio n. 1
0
        public async Task <ActionResult <ConsultaMatricula> > PostConsultaMatricula(ConsultaMatricula consultaMatricula)
        {
            _context.ConsultaMatricula.Add(consultaMatricula);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetConsultaMatricula", new { id = consultaMatricula.ConsultaMatriculaId }, consultaMatricula));
        }
Esempio n. 2
0
        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());
        }