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 DoSomething(IFoo foo);
}
List<IFoo> listA; //assume that contains items
List<IFoo> listB; //assume that contains items
foreach (var a in listA)
{
foreach (var b in listB)
{
if (b.IsCorrect(a))
{
b.DoSomething(a);
}
}
}