basically I\'m building a very generic T4 template and one of the things I need it to do is say print variable.ToString(). However, I want it to evaluate lists and
variable.ToString()
This is an old question, but I wanted to show an alternative method for determining if a SomeType is IEnumerable:
SomeType
IEnumerable
var isEnumerable = (typeof(SomeType).Name == "IEnumerable`1");