In a method, I get an object.
In some situation, this object can be an IList of "something" (I have no control over this "something").
I am trying to:
- Identify that this object is an
IList(of something) - Cast the
objectinto an "IList<something>" to be able to get theCountfrom it.
For now, I am stuck and looking for ideas.
You can check if your
objectimplementsIListusingis.Then you can cast your
objecttoIListto get the count.