title: What's the quickest way to test if an object is IEnumerable?
body: <p>Is there a quick way to find out if an <code>object</code> variable's contents supports IEnumerable? Specifically I'm using <code>XPathEvaluate()</code> from System.Xml.XPath, which can return "<a href="http://msdn.microsoft.com/en-us/library/bb341675.aspx" rel="noreferrer">An object that can contain a bool, a double, a string, or an IEnumerable.</a>"</p>
  
  <p>So after executing:</p>
  
  <pre><code>XDocument content = XDocument.Load("foo.xml");
  object action = content.XPathEvaluate("/bar/baz/@quux");
  // Do I now call action.ToString(), or foreach(var foo in action)?
  </code></pre>
  
  <p>I could poke around with <code>action.GetType().GetInterface()</code>, but I thought I'd ask if there's a quicker/easier way.</p>