G
Guest
Hello,
I'm trying to test whether an object (or type) implements a given generic
interface in C#.
Sample code :
public static bool DoesObjectImplementGenericIListInterface(Object o)
{
Type t = o.GetType();
return typeof(IList<>).IsAssignableFrom(t);
}
This code doesn't work. Any suggestions ?
Thanks
Yannick L.
I'm trying to test whether an object (or type) implements a given generic
interface in C#.
Sample code :
public static bool DoesObjectImplementGenericIListInterface(Object o)
{
Type t = o.GetType();
return typeof(IList<>).IsAssignableFrom(t);
}
This code doesn't work. Any suggestions ?
Thanks
Yannick L.