title: Extension Method. Does not contain a definition for and no extension method accepting a first argument of type
body: <p>I've written the following Extension Method:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  
  namespace Cortana.Extensions
  {
      public static class LinqExtensions
      {
          /// &lt;summary&gt;
          /// Linq method to paginate data.
          /// &lt;/summary&gt;
          /// &lt;typeparam name="T"&gt;&lt;/typeparam&gt;
          /// &lt;param name="source"&gt;The source.&lt;/param&gt;
          /// &lt;param name="pageSize"&gt;Size of the page.&lt;/param&gt;
          /// &lt;returns&gt;&lt;/returns&gt;
          public static List&lt;IEnumerable&lt;T&gt;&gt; ToPages&lt;T&gt;(this IEnumerable&lt;T&gt; source, int pageSize)
          {
              List&lt;IEnumerable&lt;T&gt;&gt; pagedSource = source
                 .Select((x, index) =&gt; new { x, index })
                 .GroupBy(a =&gt; a.index / pageSize)
                 .Select(x =&gt; x.Select(i =&gt; i.x))
                 .ToList();
  
              return pagedSource;
          }
      }
  }
  </code></pre>
  
  <p>Being called like this:</p>
  
  <pre><code>using Cortana.Extensions;
  ...
  var pagedAssessments = Model.SymptomAssessmentHistory
      .Where(x =&gt; x.IsComplete())
      .Where(x =&gt; (x.SymptomAssessmentUID != Model.CurrentSymptomAssessment.SymptomAssessmentUID))
      .OrderByDescending(x =&gt; x.TimeTaken)
      .Take(numColumnsToShow)
      .ToPages(numColumnsToShow);
  </code></pre>
  
  <p>But I get the following compiler error:</p>
  
  <pre><code>'System.Collections.Generic.IEnumerable&lt;Cortana.Models.WebApi.SymptomAssessment&gt;' does not contain a definition for 'ToPages' and no extension method 'ToPages' accepting a first argument of type 'System.Collections.Generic.IEnumerable&lt;Cortana.Models.WebApi.SymptomAssessment&gt;' could be found (are you missing a using directive or an assembly reference?)
  </code></pre>
  
  <p>Everything seems in place, what have I missed out?</p>