I have two collections, both contain objects.
First one is IList
and the second one is Dictionary
.
I need to traverse through IList and if the condition is filled then activate method from the certain object which is stored in Dictionary
.
The current situation is like this:
foreach (MyObject mo in MyListOfObjects)
{
if (mo.Active == myStatus.Enabled)
{
DictList[mo.ID].Start();
}
}
So far i've done this:
var r = MyListOfObjects.Where(mo => mo.Active == myStatus.Enabled);
But I have no idea how to include in this DictList[mo.ID].Start();