title: Breaking a loop when enumerating an IQueryable
body: <p>I have the following code:</p>
  
  <pre><code>var docs = ctx.Documents.Select(a =&gt; 
      new { a.ID, Content = a.Document, a.LastModified, CreatedDate = a.Created });
  
  foreach (var doc in docs)
  {
      if (Utility.ContinueDocumentPreview)
      {
          _createFile(doc.ID, doc.Content, doc.CreatedDate, doc.LastModified);
          _fireProgress(++counter, count);
      }
      else
      {
          break;
      }
  }
  </code></pre>
  
  <p>The Utility.ContinueDocumentPreview flag is set to false when a user hits a Cancel button while this process is running.  The problem is when the flag is false and the code should break out of the loop, I get a SQL timeout exception.</p>
  
  <p>Am I doing this incorrectly?</p>