Exemplo n.º 1
0
        public IActionResult GetStudentClassAndEnrollmentYear()
        {
            var userId = 0;

            if (Int32.TryParse(HeaderValueReader.GetUserId(Request), out userId))
            {
                var year         = facultyService.GetStudentEnrollmentYear(userId);
                var currentClass = facultyService.GetStudentClass(userId);
                return(Ok(new { academicYear = year, studentClass = currentClass }));
            }
            return(BadRequest(new { message = "Something went wrong when trying to get student class and enrollment year" }));
        }