Since IEnumerable<T>
is covariant, you can use this.
return ((System.Collections.Generic.IEnumerable<object>)value).Count();
From MSDN:
Type Parameters
out T
The type of objects to enumerate.
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived.