Ejemplo n.º 1
0
        public async Task <IActionResult> GetStudentById(int id)
        {
            var students = await studentRepsitory.GetStudentById(id);

            var StudentToReturnDto = mapper.Map <StudentForListDto>(students);

            return(Ok(StudentToReturnDto));
        }
Ejemplo n.º 2
0
        public async Task <ActionResult <Students> > GetStudentsById(int?id)
        {
            if (id == null)
            {
                return(BadRequest());
            }

            var students = await _student.GetStudentById((int)id);

            if (students == null)
            {
                return(NotFound());
            }

            return(students);
        }