thready
asked on
iterators - c# - what am I missing? body of get cannot be an iterator because MyType is not an iterator interface type
Hi Experts,
I have this c# property:
I'm getting "The body of 'NextObject.get' cannot be an iterator block because 'MyClass' is not an iterator interface type". How do I fix this?
Thanks!
Mike
I have this c# property:
public MyClass NextObject {
get
{
for(int i = 0; i < m_Objects.Count; i++) // List<MyClass> m_Objects
yield return m_Objects[i];
}
}
I'm getting "The body of 'NextObject.get' cannot be an iterator block because 'MyClass' is not an iterator interface type". How do I fix this?
Thanks!
Mike
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Not a problem thread, glad to help.
ASKER