This is probably very simple, but its been hard for me to find the answer
...
Here's the deal - I have a paged result set of data. I am using paging via LLBLGen - and it works great:
adapter.FetchEntityCollection(threadPosts, filter, 0, sortExpression, pageNumber, pageSize);
Now here is my question. I know the primary key (id field) of an entity that gets returned in the overall result set. However, I do not know what pageNumber that entity occurs on.
I can determine the row number that the result would be on via a common table expression in SQL & then use the row number & my pageSize to determine what page # that result would appear on:
WITH ExpressionSet
AS
(
SELECT ROW_NUMBER() OVER (ORDER BY CreatedDate DESC) AS RowNum,
*
FROM SomeChildTable
WHERE SomeParentID = @SomeParentID
)
SELECT RowNum
FROM ExpressionSet
WHERE SomeChildTableId = @MyKnownID
However, I have not been able to figure out how to do a similiar thing with LLBLGen. Surely this is a common issue - can someone point me in the right direction?