title: Generic pagination with the dapper
body: <p>I am using dapper and also dapper.contrib.My question is how can I create an generic pagination class.
  Here is the what I have tried so far.</p>
  
  <pre><code> public class GenericRepository&lt;T&gt; :IGenericRepository&lt;T&gt; where T : class
      {
      public  async Task&lt;IEnumerable&lt;T&gt;&gt; GetAllPagedAsync(int limit,int offset)
          {
              var list = await Connection.GetAllAsync&lt;T&gt;();//but this return IEnumarable
              return list;
  
          }
  }
  </code></pre>
  
  <p>What I am thinking is get the T name of the class which is the same as Table name,and write an sql string called <code>sql_statement</code> which is apply pagination.later apply this code.</p>
  
  <pre><code> var list = await Connection.QueryAsync&lt;T&gt;("sql_statement")
  </code></pre>
  
  <p>Does this make sense? I s there any better way to achive that.</p>