You are doing what we call an "XY question": you have a (wrong) solution in mind for your problem and you're asking about your wrong solution rather than seeking a solution to your actual problem.
You do not need to convert a list of string to a list of object in the first place, so there's no need to ask how to do that. The right solution to your problem is:
static class MyExtensions
{
public static bool Any(this IEnumerable sequence)
{
if (sequence == null)
throw new ArgumentNullException ... etc ...
if (sequence is ICollection)
return ((ICollection)sequence).Any();
foreach(object item in sequence)
return true;
return false;
}
public static bool Any(this ICollection collection)
{
if (collection == null) blah blah blah
return collection.Count > 0;
}
}
Great. Now your method is:
public static bool IsNotEmpty(object obj)
{
if (obj is IEnumerable)
return ((IEnumerable)obj).Any();
else
return true;
}
The idea here is to first go to collection because that avoids enumerating the sequence unnecessarily. That can be expensive. But if we have a sequence that has items but is not a collection, then enumerate its first element. If we can do so successfully then it is not empty; if we cannot, then it is empty.
But more generally: the signature of your method is unfortunate. Don't get into the situation where you have an object
in hand in the first place if you can possibly avoid it. How did you get into this situation?