IEnumerable when I get a real reference on the objects?
- by Steve
IEnumerable<T> collection;
void MyMethod(T toSearch)
{
foreach (T t in collection)
if (t == toSearch) {}
}
The if clause is never true.. is it because the Enumerator creates all the items instances on demand, so everytime a new Reference ?