Beispiel #1
0
        public ActionResult <Computadora> PostComputadora([FromBody] Computadora newComputer)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            var createdComp = computadorasService.CreateComputadora(newComputer);

            return(Created($"api/computadora/{createdComp.Id}", createdComp));
        }
        public ActionResult <Computadora> PostStudent([FromBody] Computadora student)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            var createStudent = computadorasService.CreateComputadora(student);

            return(Created($"/api/student/{createStudent.id}", createStudent));
        }