The general idea of swapping through the API is that the client passes the "page" of the required data and the "number" of required records.
From there you can structure your query with the effect
Select all records, but skip ((Page - 1) * amount) of records and take (amount) of records.
If you use LINQ to SQL, there are Take () and Skip () methods that help make this a lot easier to write on the code side. If you are not using LINQ to SQL, you need to find something specific Oracle.
Final note: since a good API is designed as "stateless", the client will need to support which page they are working on when accessing previous / next pages. Typically, page variables and quantities are stored in Javascript, or even something as simple as hidden variables, and can be used to calculate the number of pages available, etc.
Here is a basic sample WebAPI call that I make that makes a search call. You may need to modify it a bit to support retrieving all records, and maybe something specific to Oracle if LINQ to SQL / EF does not support it:
public IActionResult GetProducts(int? page, int? count) { var takePage = page ?? 1; var takeCount = count ?? DefaultPageRecordCount; var calls = context.Products .Skip((takePage - 1) * takeCount) .Take(takeCount) .ToList(); return Json(calls); }
source share