Pass LINQ expression as parameter to where clause
问题 Please read the question carefully before voting to close it. That is not a duplicate. I am trying to build a generic method that returns list of entities of type T joined to logs of type AuditLog. Here is a LEFT JOIN interpretation in LINQ that I use var result = from entity in entitySet from auditLog in auditLogSet.Where(joinExpression).DefaultIfEmpty() select new { entity, auditLog }; return result.GroupBy(item => item.entity) .Select(group => new { Entity = group.Key, Logs = group.Where(i