ページングがうまく動作することはありませんでした。私が見ていることは、Odata層がコントローラが返すデータをスキップしていることです(つまり、ページングとフィルタリングを制御したいということです)。 $ skip =なしでリクエストを行うと、APIは10個のレコードを返します。 $ skip = 100と設定すると、0レコードが返されます。助言がありますか?以下のコントローラメソッド:Odata webv apiサーバー側のページング
[EnableQuery(PageSize=10)]
public IHttpActionResult GetProducts(ODataQueryOptions<Product>
queryOptions)
{
List<Product> results = new List<Product>();
for (int i = 0; i < 10; i++)
{
results.Add(new Product() { Id = Guid.NewGuid(), Name=
"Product"+ i.ToString() });
}
Request.ODataProperties().NextLink =
newUri(getNextUrl(queryOptions.Skip,10));
return Ok<IQueryable<Product>>(results.AsQueryable());
}