public ActionResult <Estudiante> PostStudent([FromBody] Estudiante student) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var createStudent = estudianteService.CreateEstudiante(student); return(Created($"/api/student/{createStudent.id}", createStudent)); }
public IActionResult Post(EstudianteDTOs estudiante) //primer post de creacion o agregar un estudiante { try { return(new JsonResult(_service.CreateEstudiante(estudiante)) { StatusCode = 200 }); } catch (Exception e) { return(BadRequest(e.Message)); } }