// 3 Views For Ordered Courses public ActionResult GetASpecificCourseOrders(int courseId) { var courseOrders = _enrollmentRepository.GetASpecificEnrollmentOrder(courseId).ToList(); if (!ModelState.IsValid) { return(BadRequest()); } var ordersDto = new List <EnrollmentDto>(); foreach (var order in courseOrders) { ordersDto.Add(new EnrollmentDto { CourseID = order.CourseID, StudentID = order.StudentID, Status = order.Status }); } return(Ok(ordersDto)); }