Linq Join With Include Statement

后端 未结 2 1968
鱼传尺愫
鱼传尺愫 2021-02-19 06:07
IQueryable emps = CreateObjectSet()
                                  .Include(u => u.Departments)
                                  .         


        
2条回答
  •  孤城傲影
    2021-02-19 06:30

    This can be solved with the following code:

    var query = from emp in emps
                join prod in prods
                on emp.ProductID equals prod.ProductID
                where emp.EmployeeID == 10
                select employee;
    var result = query.Include(u => u.Departments)
    

提交回复
热议问题