У меня проблема с linq to sql. Мой sql запрос:
Select emp_name from employee where emp_manager_id in (Select emp_id from employee where dept_id in
(Select dept_id from department where dept_name='admin')
)
and emp_salary between
(Select min_salary from salarygrades where grade='B')
and
(Select max_Salary from salarygrades where grade='B')
Я пытаюсь преобразовать это в выражение linq, тогда у меня возникает проблема
var min_salary = from salarygrade in dbe.salarygrades where salarygrade.grade == "B" select salarygrade.min_Salary;
var max_salary = from salarygrade in dbe.salarygrades where salarygrade.grade == "B" select salarygrade.max_Salary;
var dept_id = from department in dbe.departments where department.dept_name.Contains("admin") select department.dept_id;
var manager_id = from employee in dbe.employees where dept_id.Contains(employee.dept_id) select new { employee.emp_manager_id, employee.emp_id, employee.dept_id };
var manager_id = from employee in dbe.employees where dept_id.Contains(employee.dept_id) select new { employee.emp_manager_id, employee.emp_id, employee.dept_id };
Iполучаю IQueryable<int>
не содержит определения для методов Contains