title: Generic extension method refactor
body: <p>I'm wondering if the following can be refactored in the way I would like it:</p>
  
  <pre><code>[EditorBrowsable(EditorBrowsableState.Never)]
  public static class ListExtensions
  {
      public static PaginatedList&lt;Y&gt; ToMappedPaginatedList&lt;T, Y&gt;(this PaginatedList&lt;T&gt; source)
      {
          var mappedList = new List&lt;Y&gt;();
          Mapper.Map(source, mappedList);
  
          return new PaginatedList&lt;Y&gt;(mappedList, source.PageIndex, source.PageSize, source.TotalCount);
      }
  }
  </code></pre>
  
  <p>The Mapper.Map line is using AutoMapper to map properties from an entity to a DTO object.</p>
  
  <p>This is called like this:</p>
  
  <pre><code>var list = await _service.GetAllAsync(pageIndex, _pageSize);
  var dtoList = list.ToMappedPaginatedList&lt;Farmer, FarmerDTO&gt;();
  </code></pre>
  
  <p>but I'd like to call it like this:</p>
  
  <pre><code>var dtoList = list.ToMappedPaginatedList&lt;FarmerDTO&gt;();
  </code></pre>
  
  <p>This saves a little bit of typing and you don't always need to be aware of the source list its type. Unfortunately this code doesn't work and I'm not sure if there's a simple answer.</p>
  
  <p>Anyone got an idea?</p>
  
  <p>Thanks in advance.</p>
  
  <p>Yannick</p>