Skip to content

Instantly share code, notes, and snippets.

@markholdt
Created January 9, 2016 15:59
Show Gist options
  • Save markholdt/5a917dc927aa8a7ba75f to your computer and use it in GitHub Desktop.
Save markholdt/5a917dc927aa8a7ba75f to your computer and use it in GitHub Desktop.
Paging request & response example
[Route("/listings", "GET")]
public class GetListings : IReturn<GetListingsResponse>
{
// this parameter is used for requesting a specific page
public int? PageNr { get; set; }
// other default request parameters, not needed for paging but included for illustrative purposes
public int? CategoryId { get; set; }
public int? PriceFrom { get; set; }
public int? PriceTo { get; set; }
}
public class GetListingsResponse
{
public List<Listing> Result { get; set; }
public int TotalPageCount { get; set; } // total number of pages
public int CurrentPageNr { get; set; } // current page number
public int TotalRecords { get; set; } // total number of records
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment