linq to sql - Accessing Joined Tables in Linq2SQL When Returning IQueryable -


i have linq query draws data set out of database, unfortunately due legacy nature of database requires manual "join" enacted part of query.

now need add further optional filters data set, of rely on joined table - if return data set first query .asqueryable() how go accessing joined table, doesn't seem available iquerable?

example:

var myquery = (from o in db.firsttable                    join t in db.secondtable on o.secondid equals t.id                    select o).asqueryable();  // (optional - if statement excluded brevity) myquery = x in myquery t.somefield.equals("my filter value"); 

whichever properties need out of table, have grab in select. so, change select "select o" "select o.property1, o.property2, t.property1, t.property2"


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -