How do I get a right outer join in L2E?

Posted by Dan on Stack Overflow See other posts from Stack Overflow or by Dan
Published on 2010-06-11T18:13:25Z Indexed on 2010/06/11 18:52 UTC
Read the original article Hit count: 293

Filed under:
|

I have two tables that I set up through the VS Entity Data Model Diagram tool. I'm trying to do a right outer join and it doesn't return results from the 2nd table.

I have set up a 0..1 to MANY relationship from the diagram tool.

When I run a Linq-To-Entities query, it still defaults to an INNER JOIN. From my understanding of entities, if I set up the relationship using VS, when I join the tables, it should automagically figure out the join syntax based on the relationship I supply. It doesn't seem to be doing that.

I am using EF v1 (not Linq-to-Sql).

Query I'm running:

from s in SomeTable 
join t in SomeOtherTable on s.ID equals t.ID
select new { s.MyFieldName, t.MyOtherFieldName }

© Stack Overflow or respective owner

Related posts about LINQ

Related posts about linq-to-entities