I am wondering about getting rid of some nested foreach's in my code using LINQ. For example, assume the following code:
IEnumerable<MyObject1> MyObject1Collection = SomeCollection.Cast<MyObject1>()
foreach (MyObject1 obj1 in MyObject1Collection)
{
foreach (MyObject2 obj2 in MyObject1.MyObject2Collection) {
if (MyObject2.IsFalse)
{
// Do Stuff
}
}
}
Is there a better way to do this with LINQ?
TIA!