System.Collections.IEnumerable


class MyList2<T> : IEnumerable<T> 
{
}

MyList2<string> mylist;
mylist = new MyList2<string>();
mylist.Add("Monday");
mylist.Add("Tuesday");

foreach (string s in mylist)
{
   System.ConsoleWriteLine(s);
}

Generic Collection - IEnumerable<T>
Enumerating a generic collection class

System.Collections.Generic.List<string> mylist; 
mylist = new System.Collections.Generic.List<string>();
mylist.Add("Monday");
mylist.Add("Tuesday");

foreach (string s in mylist)
{
   System.ConsoleWriteLine(s);
}


© 2019 Better Solutions Limited. All Rights Reserved. © 2019 Better Solutions Limited TopPrevNext