0

i have 2 table (user, user_profile) without a explicit relationship in the sql db. and i can't add it to the db.

so, i can't do this:

db.user.include("user_profile")

the attribute in for the join is user_id

is possible do anything like this?

db.user.join("user_profile On user.id = user_profile.user_id")

How can i do that?

thanks

Luca Romagnoli
  • 12,145
  • 30
  • 95
  • 157

1 Answers1

5

Try this :

from u in db.user
join up in db.user_profile on u.id equals up.user_id
select new { u, up};
FarFigNewton
  • 7,108
  • 13
  • 50
  • 77
Frans Bouma
  • 8,259
  • 1
  • 27
  • 28