I have this function that needs to be converted to a lambda statement:
public int someFunction()
{
int pCount = 0;
foreach (Top top in Tops)
{
foreach (P p in top.TopPs)
{
pCount++;
}
}
return pCount;
}
Added more clarity:
Tops and top.TopPs extends ObservableCollection
How do i do it?
Here’s an alternative method: