title: Cast received object to a List<object> or IEnumerable<object>
body: <p>I'm trying to perform the following cast  </p>
  
  <pre><code>private void MyMethod(object myObject)  
  {  
      if(myObject is IEnumerable)  
      {
          List&lt;object&gt; collection = (List&lt;object&gt;)myObject;  
          ... do something   
      }  
      else  
      {  
          ... do something  
      }  
  }
  </code></pre>
  
  <p>But I always end up with the following excepction:  </p>
  
  <p>Unable to cast object of type 'System.Collections.Generic.List<code>1[MySpecificType]' to type 'System.Collections.Generic.List</code>1[System.Object]'  </p>
  
  <p>I really need this to work because this method needs to be very generic to receive single objects and collections both of unspecified types.  </p>
  
  <p>Is this possible, or is there another way of accomplishing this.  </p>
  
  <p>Thank you.</p>