I want to using join method for the following queryin Linq To SQL
What works correctly:
var db = new DatabaseDataContext();
db.DeferredLoadingEnabled = false;
var q = from p in db.Persons
join c in db.Contacts on c.personId equal p.Id
join j in db.Jobs on j.personId equal p.Id
select SetPersonItems(p,c,j) ;
and what is SetPersonItems:
private Person SetPersonItems(Person p, Contact c, Job j)
{
p.Contact = c;
p.Job = j;
return p;
}
What I need:
Now I would like using of Join Method for the above query. Like:
var q = db.Persons.Join<......>(db.Contacts,...).Join<....>(db.Jobs,...).Select....
p.s. Later I will create a dynamic method for the above Multiple Join (Join methods)