title: Combining the use of Skip Tokens and Server-Side Filtering in WCF Data Services v2
body: <p>How does one combine the use of filtering and server-side paging in WCF Data Services (version 2)?</p>
  
  <p>In the code snippet below, the NextLinkUri is always has the $filter query param missing. I've tried contructing a new Uri with the NextLinkUri and adding the $filter param back in and executing this new Uri instead. Not surprisingly, this causes a server-sider error.</p>
  
  <pre><code>var query3 = ServiceContext.ConventionalReturnFacts;
  var filterString = String.Format("CalendarDateId ge {0} and CalendarDateId lt {1}",
                      passedCalendarYear * 10000,
                      (passedCalendarYear + calendarYearIncrement) * 10000);
  query3.AddQueryOption("$filter", filterString);
  
  // Get first page of results
  var response = query3.Execute();
  result.Results = response.ToList();
  
  // Get remaining pages (if any)
  var continuation = ((QueryOperationResponse)response).GetContinuation();
  while (continuation != null)
  {
      // NextLinkUri is missing the $filter query parameter so pages 2 and
      // up end up having unfiltered entities!
     response = ServiceContext.Execute&lt;ConventionalReturnFact&gt;(continuation.NextLinkUri);        
     ((List&lt;ConventionalReturnFact&gt;)result.Results).AddRange(response.ToList());
     continuation = ((QueryOperationResponse)response).GetContinuation();
  }
  </code></pre>