How to determine if object is of type IEnumerable ?
Code:
namespace NS { class Program { static IEnumerable GetInts()
i is of type NS.1.Program+d__0, which is a subtype of IEnumerable. Thus, you can use either
i
NS.1.Program+d__0
IEnumerable
if (i is IEnumerable) { ... }
or IsAssignableFrom (like in Marc's answer).
IsAssignableFrom