angular-datatables icon indicating copy to clipboard operation
angular-datatables copied to clipboard

left join with group by linq lambda expression c#?

Open Coderwill opened this issue 9 years ago • 1 comments

i want to write left join using linq lambada expression. i have try query using join but now i want to create using left join so any one can help me how can do.

here this is my query:

var UserList = db.UserInfo .Join(db.Coruse, u => u.id, c => c.userid, (u, c) => new { u, c }).GroupBy(r => r.u.id) .Select(g => g.OrderByDescending(r => r.c.datetime) .FirstOrDefault()).OrderByDescending(a => a.u.datetime).ToList();

using this query i don't want user data those who are not in coruse taable so i want to this data also in coruse table in userid in or not.

Coderwill avatar Apr 01 '17 06:04 Coderwill

Wrong repository?

l-lin avatar Apr 02 '17 13:04 l-lin