I need a help on Reflection.
I am facing a problem while Iterating the List in reflection.
var item = property.GetValue(obj,null); //This will return List of Student. Actually We dont know the type of obj ie Student, as it is in Reflection.
foreach(var value in (item as IEnumerable))
{
//Do stuff
}
if i do like this i am getting error like,
Using the generic type 'System.Collections.Generic.IEnumerable
Please help me.

VulpesPosted May 10, 2011, 9:51 AM
using System.Collections.Generic;
If you add the non-generic version as well, then your code should work:
using System.Collections;
Jaganathan BantheswaranPosted May 11, 2011, 1:08 AM
Yes vulpes, Its working.. Thanks..