I have this SQL query
select at.description,
a.Address1,
a.Address2,
a.City
from address_types at
left join Address a
on a.addresstype = at.addresstype
and a.addressid=24
Would like to write it in Linq Lambda Expression, any clue?
Thanks!
I would rather simplify it in following way
The reason why we don’t need this check “(ja == null)” is because we already restricted our set in this line “where (ar != null && ar.addressid == 24)”.
Meanwhile this query works, my POV is that LEFT JOIN is also redundant here in the SQL query. You will not get NULL rows due to your condition “a.addressid = 24” so SQL can be rewritten to INNER JOIN and LINQ query as well to