Add the following explicit interface implementation:
IEnumerator IEnumerable.GetEnumerator()
{
return this.GetEnumerator();
}
Although IEnumerator
is an IEnumerator
, the contract for IEnumerable
returns an IEnumerator
specifically, not an IEnumerator