title: SharePoint CSOM C# Load Query with Where Clause Performance
body: <p>How does SharePoint CSOM handle this block of code?</p>
  
  <pre><code>FileCollection allDocs = libFolder.Files;
  clientContext.Load(allDocs, files =&gt; files.Where(file =&gt; file.Name == "test.docx");
  clientContext.ExecuteQuery();
  
  if (allDocs.Count &gt; 0)
  {
      File currentDoc = allDocs[0];
      // continue
  }
  </code></pre>
  
  <p>Is the "allDocs" collection fully enumerated, or does the Where clause in the Load parameters pinpoint a single file?</p>
  
  <p>Also, there has to be a better way of retrieving a file by filename in CSOM without the "allDocs[0]" indexed collection selection. <strong><em>How would you do it?</em></strong></p>