Exemplo n.º 1
0
        public async Task <IActionResult> GetEstudiante(long Id)
        {
            var estudiante = await _estudianteService.GetEstudiante(Id);

            var estudianteDTO = _mapper.Map <EstudianteDTO>(estudiante);
            var response      = new APIResponse <EstudianteDTO>(estudianteDTO);

            return(Ok(response));
        }
Exemplo n.º 2
0
        public ActionResult <Estudiante> GetEstudiante(int id)
        {
            try
            {
                return(Ok(estudianteService.GetEstudiante(id)));
            }

            catch (Exception ex)
            {
                return(StatusCode(StatusCodes.Status500InternalServerError, ex.Message));
            }
        }