The Include
method is just for listing the related types/tables to load as part of the query. This sets up the JOIN used in the query. To actually filter on the table you would use a subsequent where clause. However you don't need a where clause here. The ON portion of the JOIN in SQL translates to the relationship defined in EF. In your EF configuration for the table you will have specified that Department has a one-to-one relationship with Semester and you would have specified that the relationship is between the names. This allows EF to properly join the tables.
.Include(ca => ca.Department) // JOIN Department ON <defined in EF configuration>
.Include(ca => ca.Department.TblCourses) //JOIN Courses ON <defined in EF configuration>
.Include(ca => ca.Department.TblPrograms) //JOIN Programs ON <defined in EF configuration>
.Include(ca => ca.Department.TblSemesters) //JOIN Semesters ON <defined in EF configuration>
.Where(ca => ca.EmployeeCode.Equals(employee.EmployeeCode) //WHERE EmployeeCode = ....
& ca.SemesterName.Equals(semester) // AND SemesterName = ...
& ca.PaymentStatus.Equals("Regular/Unpaid") // AND PaymentStatus = "Regular/Unpaid"
)
.AsSplitQuery() //Have no idea what this is doing
.OrderBy(d => d.ProgramSession // ORDER BY ProgramSession