, LINQ () , SQL, SQL-, Entity Framework. :
var results = from u in UserDataSource
join t1 in Table1DataSource on u.UserId = t1.UserId into gj
from jt1 in gj.DefaultIfEmpty()
select new {u.UserId, Table1Data = jt1 == null ? String.Empty : jt1.Data};
If the tables are really huge or there is additional processing to execute the result, I would think about creating a view on the server and map it to the code Entity. Then it becomes a very simple choice; you just filter the view results for the user IDs you want to see.
source
share