title: Unable to cast object of type 'WhereArrayIterator`1[System.String]' to type 'System.String[]'
body: <p>I'm trying to get sub directories paths from a directory, but ignore some folders, the code below gives me this error, </p>
  
  <p>System.InvalidCastException: Unable to cast object of type 'WhereArrayIterator`1[System.String]' to type 'System.String[]'</p>
  
  <p>can anyone help?</p>
  
  <pre><code>Dim subdirectoryEntries() As String = Directory.GetDirectories(ConfigurationSettings.AppSettings("FsRoot") &amp; Path.DirectorySeparatorChar &amp; readerClientList.GetString(0)).
  Where(Function(name) Not name.EndsWith(folder, StringComparison.OrdinalIgnoreCase))
  </code></pre>