This project is read-only.

Paging

Oct 8, 2012 at 5:51 PM

I was trying to find the relevant section in the restful spec about when the data returned needed to split over multiple pages.

It seemed like this was an optional future part of the spec, I noticed that restful objects only returned the top 20 objects, I also couldn't see any links that would give me the next 20 objects.

Is there a way to do this at present ?

Oct 8, 2012 at 6:44 PM

Sorry, as you have surmised, paging is not yet provided for in the RO spec  -  it will be in a future version.

Meantime you will need to provide your own methods for paging e.g.:

 

public class CustomerRepository {

  public IQueryable<Customer>  Customers(int pageNo) {
    return Container.Instances<Customer>().Skip(pageSize*20).Take(20);

  }

Note that if you want a page size larger than 20 you can set this with the [PageSize] attribute.