GenericUser
GenericUser

Reputation: 229

Multiple joins in linq

I just learned how the work with asp.net and I am trying to write a linq-statement with multiple join, but I dont seem to make it work.

I have 4 tables:

I want to you enter the page competition.aspx I want to display the entered entries within the different rounds.

Can someone help me with the statement, as well a suggestion how to build up my page.

Upvotes: 0

Views: 106

Answers (1)

Sergey Berezovskiy
Sergey Berezovskiy

Reputation: 236328

Assume you have data context named db and tables have keys named Id.

var entries = from e in db.Entry
              join re in db.RoundEntry on e.Id equals re.EntryId
              join r in db.Round on re.RoundId equals r.Id
              select e;

Upvotes: 2

Related Questions