sql - How to use null in join condition in linq -



sql - How to use null in join condition in linq -

i having problem in translating sql statement linq query. have not found way how utilize null in bring together status or. here sample sql statement:

select a.* tablea bring together tableb b on (a.id = b.id) or a.id null

what equivalent linq statement? looking bring together status same 1 in above sql statement.

from in tablea bring together b in tableb on ??? equals ??? select a;

i have searched existing post apparently couldn't find 1 on specific issue. thanks.

joins pretty picky, can utilize them specific things. however, it's easy same result nested from statements:

from in tablea b in tableb a.id == b.id or a.id == null select a;

also, depending on info you're trying find, may more appropriate query:

from in tablea a.id == null || tableb.any(b => b.id == a.id) select a;

sql .net linq

Comments

Popular posts from this blog

maven fortify plugin : Unable to load build session with ID XXXXX .. See log file for more details -

c# - Primavera WebServices does not return any data -

android - Display emoji panel with genymotion - keyboard/touch input? -