Hi guys, This is my first question in stackoverflow but really not the first time to get solution here. I am struggling with multiple join in entity framework 4. I have three tables (Accounts, Users and AccountUsers) that am finding difficult to query.
What I want is to get all the users for the provided accountId including the account creator. I can get all the account users with no problem but the hard side for me is getting the account creator since it's not added to AccountUsers table. below is a quick preview how the tables are related.
Accounts
- AccountId
- UserId (account creator)
- ...other columns
Users
- UserId
- ...other columns
AccountUsers
- AccountId
- UserId
I would prefer the query to be esql, but Linq to Entities will do.
I trust you guys on stackoverflow, so I know this won't take long to get the 'Answer' mark.
Thanks for even reading.