Posts

Showing posts from October, 2013

Difference between IEnumerator and IEnumerable

IEnumerator is an interfaces. An IEnumerator is a that can enumerate. It has 2 methods (MoveNext and Reset) and a property Current. To use IEnumerator is if you want a nonstandard way of enumerating (not iterating one-by-one) and want to define custom iteration. You create a new class implementing IEnumerator. Code Snippet:     public class MyCustomIterate:IEnumerator     {         public object Current         {             get { throw new NotImplementedException(); }         }         public bool MoveNext()         {             throw new NotImplementedException();         }         pub...