I\'m trying to perform the following cast
private void MyMethod(object myObject) { if(myObject is IEnumerable) { List c
Problem is, you're trying to upcast to a richer object. You simply need to add the items to a new list:
if (myObject is IEnumerable) { List list = new List(); var enumerator = ((IEnumerable) myObject).GetEnumerator(); while (enumerator.MoveNext()) { list.Add(enumerator.Current); } }