title: How to know if Array FileInfo[] contains a file
body: <p>I have the following code, I receive an error at "if statement" saying that FileInfo does not contain a definition "Contains"</p>
  
  <p>Which is the best solution for looking if a file is in a directory? </p>
  
  <p>Thanks</p>
  
  <pre><code>string filePath = @"C:\Users\";
  DirectoryInfo folderRoot = new DirectoryInfo(filePath);
  FileInfo[] fileList = folderRoot.GetFiles();
  
  IEnumerable&lt;FileInfo&gt; result = from file in fileList where file.Name == "test.txt" select file;
  if (fileList.Contains(result))
  {
        //dosomething
  }
  </code></pre>