Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- I am trying to write a LINQ query, just some inner joins and one left outer join. So when I do the left outer join for classes something like this, its too expensive and I am getting a timeout error.
- from p in context.Professors
- join d in context.Departments
- join c in context.Classes on c.ClassId equals p.ClassId into cs
- from c in cs.DefaulIfEmpty()
- But if I do it something like this, it works perfectly fine, and not expensive, no timeouts:
- from p in context.Professors
- join d in context.Departments
- from c in context.Classes.Where(x=>.ClassId == p.ClassId).DefaultIfEmpty()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement