ReFocus
ReFocus

Reputation: 1521

EntityFramework 5 multiple joins

This page shows nicely how to cope with different scenario's for fetching data: http://msdn.microsoft.com/en-us/library/gg671236%28v=vs.103%29.aspx

How do I select a collection and two references? (Lines have a ProductId and an AddressId, I want to include both...)

In other words, where do I put my Level1Reference2 in:

query.Include(e => e.Lines.Select(l1 => l1.Level1Reference)) // Level1Reference2?

Upvotes: 0

Views: 196

Answers (1)

Gert Arnold
Gert Arnold

Reputation: 109079

Just repeat an Include:

query.Include(e => e.Lines.Select(l1 => l1.Level1Reference))
     .Include(e => e.Lines.Select(l1 => l1.Level1Reference2))

Upvotes: 1

Related Questions