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
object
into an "IList<something>
" to be able to get theCount
from it.
For now, I am stuck and looking for ideas.
Count
all you want? If so, you don't need it to be anIList<T>
, a simpleIEnumerable
will do. – AthertonCount
is all that I want. However, I can't see anyCount
inIEnumerable
? – Chiachiack