I have a IList of objects. They are of type NHibernate.Examples.QuickStart.User. There is also an EmailAddress public string property.
Now I can loop through that list with a for each loop.
Is it possible to loop through a Ilist with a simple for loop?
Because simply treating the IList as an array doesn't seem to work...
System.Collections.IList results = crit.List();
foreach (NHibernate.Examples.QuickStart.User i in results)
{
Console.WriteLine(i.EmailAddress);
}
for (int i = 0; i < results.Count; ++i)
{
Console.WriteLine(results[i].EmailAddress); // Not Working
}