I have a code which is similar to the following, but more complex:
IEnumerable<SomeObject> GetObjects()
{
if (m_SomeObjectCollection == null)
{
yield break;
}
foreach(SomeObject object in m_SomeObjectCollection)
{
yield return object;
}
GetOtherObjects();
}
IEnumerable<SomeObject> GetOtherObjects()
{
...
}
I have just realized, that GetOtherObjects()
method cannot be called from OtherObjects()
method. There are no errors, but the iteration stops. Is there any way to solve it?