Let's say I have a Child
class that derives from a Parent
class. How can I write the following function?
public bool IsListOfParent(object obj)
{
// return true if obj implements IList<Parent> (including IList<Child>)
}
When I try return obj is IList<Parent>
it returns false for an object of type List<Child>
.