I\'d like to ask if it is possible to convert below nested foreach loops to LINQ expression.
public interface IFoo { bool IsCorrect(IFoo foo); void DoSom
With method syntax you would use this query:
var correctPairs = listA .SelectMany(a => listB.Where(b => b.IsCorrect(a)).Select(b => new { a, b })); foreach (var x in correctPairs) x.b.DoSomething(x.a);