title: C# how to make a function that can return either child or parent class
body: <p>Not sure if I made it clear on the title. What I want is this:<br>
  There is a parent class:  </p>
  
  <pre><code>public class parent  
  ....  
  </code></pre>
  
  <p>And a child class:  </p>
  
  <pre><code>public class child : parent  
  ....  
  </code></pre>
  
  <p>Now I need a method that can return either:  </p>
  
  <pre><code>List&lt;(what goes here?)&gt; GetSomeValue(string id, boolean needChild) {  
    ......  
    if (needChild)  
      return BuildChildResult(id);  
    else  
      return BuildParentResult(id);  
  }  
  </code></pre>
  
  <p>Is this something possible to do?<br>
  What should be in the bracket?</p>