If I have a criteria of:
var criteria = new CompositeCriteria<CommentFilter, CommentsExtensionModel>
{
Filter = new CommentFilter { Ancestor = ancestralComment },
PageInfo = new PageInfo { PageSize = 2, PageOffset = 0, CalculateTotalCount = true},
OrderBy = { new SortInfo(CommentSortFields.Created, true) }
};
Call the service:
var results = _commentService.Get(criteria)
It works, no issues, 2 Results, Total Matching 5.
And as an example lets say it returns
results.Results[0].Data.Id = 123
results.Results[1].Data.Id = 456
All fine.
Now if I paginate:
var criteria = new CompositeCriteria<CommentFilter, CommentsExtensionModel>
{
Filter = new CommentFilter { Ancestor = ancestralComment },
PageInfo = new PageInfo { PageSize = 2, PageOffset = 1, CalculateTotalCount = true},
OrderBy = { new SortInfo(CommentSortFields.Created, true) }
};
Again I get 2 more results, but the issue I am seeing is that:
results.Results[0].Data.Id = 456
results.Results[1].Data.Id = 789
As you can see the results returned after the pagination includes the last previous result.
Is this by design or is this a bug?
Thanks