To Enumerate over Custom Class,The Class must implement IEnumerable and must have method defined for GetEnumerator.
public class EmployeeArray:IEnumerable { public int index; public Employee[] objarray; public EmployeeArray(Employee[] Array ,int startindex ) { objarray = Array; index = startindex; } public IEnumerator GetEnumerator() { for (int i = 0; i <;objarray.Length; i++) { yield return objarray[(index+i) % objarray.Length]; } }