LINQ: Build dynamic filter with sequence of ANDs
问题 I'm struggling to dynamically create a query like that: Dictionary<string, Guid> parms = new Dictionary<string, Guid>(); foreach (var kvp in parms) { var exp = ReportDefinitions.Where(x=> x.Discriminants.Any(y=> y.Key == kvp.Key && y.Value == kvp.Value) // && more conditions to add here at each cycle ); } Where ReportDefinitions.Discriminants is an IDictionary<string, Guid> ; I know how to build simple Expression but I can't figure out how to build this one the "Any" seems really complicated.