title: How to refactor operation for list<object>/object?
body: <p>I'm working on kind of mapper which use <code>System.Reflection</code>, and in one case I have possibilities to have list of objects or normal object in my value, and make some logic with it. </p>
  
  <p><strong>It looks like this more less:</strong></p>
  
  <pre><code>if (myValue is IList) {
      foreach (var value in myValue) {
          ...
          DoSth(value);
          ...
      }
  } else {
      ...
      DoSth(myValue);
      ...
  }
  </code></pre>
  
  <p>and I have no concept to refactor it, and don't duplicate code (<code>DoSth()</code> in this case). Is there some way to do this better?</p>