title: Who's responsibility should be to paginate controller/domail service/repository?
body: <p>My question might seem strange for pros but please take to account that I am coming from ruby on rails world =)</p>
  
  <p>So, I am learning ASP.NET Core. And I like what I am seeing in it compared to rails. But there is always that but... Let me describe the theoretical problem.</p>
  
  <p>Let's say I have a <code>Product</code> model. And there are over 9000 records in the database. It is obvious that I have to paginate them. I've read <a href="https://docs.microsoft.com/en-us/aspnet/core/data/ef-mvc/sort-filter-page" rel="nofollow noreferrer">this</a> article, but it seems to me that something is wrong here since the controller shouldn't use <code>context</code> directly. It has to use some repository (but that example might be provided in such a way only for simplicity).</p>
  
  <p>So my question is: who should be responsible for pagination? Should it be the controller which will receive some queryable object from the repository and take only those records it needs? Or should it be my own business service which does the same? Or should the repository has a method like <code>public IEnumerable&lt;Product&gt; ListProducts(int offset, int page)</code>?</p>