Linq to Entities - Internal Behavior of Skip and Take
<p>I have a question about the internal behavior of Skip and Take. Do subsequent calls to skip and take move an internal pointer forward?</p>

<p>So, in other words, is:</p>

<pre><code>var rowset = entities.ActivityRecords
                    .Where(ar =&gt; ar.State == (int)LineItemStates.Created 
                        &amp;&amp; ar.Timestamp &gt;= cycleIteration.StartDate //within the date range
                        &amp;&amp; ar.Timestamp &lt;= cycleIteration.EndDate 
                        &amp;&amp; matchingProducts.Contains(ar.ProductId))
                    .OrderBy(ar2 =&gt; ar2.Id);

rowset.Skip(10); //only works if we're consuming an iterator and the pointer is moving forward. Does this move an internal pointer forward?
return rowset.Take(10);
</code></pre>

<p>equivalent to:</p>

<pre><code>var rowset = entities.ActivityRecords
                    .Where(ar =&gt; ar.State == (int)LineItemStates.Created 
                        &amp;&amp; ar.Timestamp &gt;= cycleIteration.StartDate //within the date range
                        &amp;&amp; ar.Timestamp &lt;= cycleIteration.EndDate 
                        &amp;&amp; matchingProducts.Contains(ar.ProductId))
                    .OrderBy(ar2 =&gt; ar2.Id);

return rowset.Skip(10).Take(10);
</code></pre>

<p>I have a bug I'm investigating, and I believe the problem is that the r.Take(x) is in a loop where the intent is to keep taking <code>x</code> rows with each loop execution and thus consume the entire set, but I'm guessing the latter code snippet is required over the former as I don't think Skip and Take are really moving any internal pointer iterator forward.</p>