title: C# Dynamic select List of strings
body: <p>I'm trying to get <code>List</code> of strings from my dynamic object list and it keeps saying that:</p>
  
  <blockquote>
    <p>Error 1   Cannot implicitly convert type
    '<code>System.Collections.Generic.List&lt;dynamic&gt;</code>' to
    '<code>System.Collections.Generic.List&lt;string&gt;</code>'</p>
  </blockquote>
  
  <p>I'm  selecting a property and use <code>.ToString()</code> on it:</p>
  
  <pre><code>var objects = new List&lt;dynamic&gt;();
  //filling objects here
  
  List&lt;string&gt; things = objects.Select(x =&gt; x.nameref.ToString()).ToList();
  </code></pre>
  
  <p>So isn't it a valid List of strings? Why compiler is assuming that this list is of type <code>dynamic</code>?</p>
  
  <p>I've tried also converting from <a href="https://stackoverflow.com/questions/7827407/c-sharp-best-way-to-convert-dynamic-to-string">this</a> answer, but it keeps giving me same error. </p>
  
  <p>Anyone knows how to make it <code>List&lt;string&gt;</code>?</p>
  
  <p>EDIT:</p>
  
  <p>Why isn't it working? Because you can make <strong>mess</strong> like this:</p>
  
  <pre><code>public class Test
  {
      public int ToString()
      {
          return 0;
      }
  }
  </code></pre>
  
  <p>and compiler won't know if <code>ToString</code> returns <code>string</code> or <code>int</code>.</p>