Check out example codes for "add getenumerator to class c#". It will help you in understanding the concepts better.

Code Example 1

public bool MoveNext()
{
      position++;         
      return (position < carlist.Length);      
}      
public void Reset() => position = 0;
public object Current {         
       get { return carlist[position];}      
}

Learn ReactJs, React Native from akashmittal.com