我想在 IQueryable 中加入两个实体
这就是我所做的:
IQueryable<EmployeeSchedule> employeeScheduleResult =
from empSched in ctx.EmployeeSchedules.ToList()
join emp in ctx.Employees.ToList() on empSched.EmployeeId equals emp.EmployeeId
select new {
empSched.ScheduleId,
empSched.ScheduleDt,
empSched.Branch,
empSched.StartTime,
empSched.EndTime,
empSched.LunchTime,
empSched.LunchBreak,
empSched.LunchBreak_NS,
Employee = emp.LastName + emp.FirstName + emp.MiddleName
};
这是我收到的错误:
无法将类型“System.Collections.Generic.IEnumerable”隐式转换为“System.Linq.IQueryable”。存在显式转换(您是否缺少演员表?)