title: c# LINQ: Filter List of Files based on File Size
body: <p>I need some help using LINQ to filer a list of files based on the file size. I have some code but it's using file.length instead of FileInfo(file).length. I don't know how to implement an object 'FileInfo' in the expression. HELP?</p>
  
  <pre><code>        {            
              IEnumerable&lt;string&gt; result = "*.ini,*.log,*.txt"
              .SelectMany(x =&gt; Directory.GetFiles("c:\logs", x, SearchOption.TopDirectoryOnly))
                              ;
  
              result = result
                  .Where(x =&gt; (x.Length) &gt; "500000")
  
                 ;
  
         }
  </code></pre>