任何人都可以帮助我将以下 SQL 查询转换为 LinqToSql 语法。它涉及我的表中的多个表。我不确定我是否使用了正确的查询类型。任何帮助将不胜感激。
public IQueryable<tblCourseNeededHours>(int departmentId, string semester)
{
return from =
"SELECT tblCourseNeededHours.Semester, tblCourseNeededHours.NeededHoursPerWeek,
tblCourseNeededHours.AssignToInstituteAdministrator,
tblCourseNeededHours.Freezed, tblCourse.CourseName,
tblInstitute.InstituteName, tblDepartment.DepartmentName
FROM tblCourseNeededHours
INNER JOIN tblCourse ON
tblCourseNeededHours.CourseID = tblCourse.CourseID
INNER JOIN tblInstitute ON
tblCourse.InstituteID = tblInstitute.InstituteID
INNER JOIN tblDepartment ON
tblInstitute.DepartmentID = tblDepartment.DepartmentID";
}