weird...
I don't know about you but I can't see posts after first page (with cacheEnabled)!
This only happen in
VB.
One of the thread functions in Post Class is:
Code:
Dim posts As List(Of Post) = Nothing
Dim key As String = "Forums_Thread_" & threadPostID.ToString()
If BaseForum.Settings.EnableCaching AndAlso Not IsNothing(BizObject.Cache(key)) Then
posts = CType(BizObject.Cache(key), List(Of Post))
Else
Dim recordset As List(Of PostDetails) = SiteProvider.Forums.GetThreadByID(threadPostID)
posts = GetPostListFromPostDetailsList(recordset)
BaseForum.CacheData(key, posts)
End If
Dim count As Integer = maximumRows
If posts.Count < startRowIndex + maximumRows Then count = posts.Count - startRowIndex
Dim array As Post()
ReDim array(count - 1)
posts.CopyTo(startRowIndex, array, 0, count) ' was count
posts.Clear()
posts.AddRange(array)
Return posts
After some time trying understand, the line "Post.Clear" update the cache! If the post.count was "15" after the first the count will be updated to the MaximumRows...
I changed to:
Code:
Dim count As Integer = maximumRows
If posts.Count < startRowIndex + maximumRows Then count = posts.Count - startRowIndex
'Dim array As Post()
'ReDim array(count - 1)
'posts.CopyTo(startRowIndex, array, 0, count) ' was count
'posts.Clear()
'posts.AddRange(array)
Return posts.GetRange(startRowIndex, count)
And it worked...
Beside I don't understand why marco used posts.CopyTo when he could simply used posts.GetRange
Doesn't C# have list.rangeTo(startIndex, count) ?
I hope it helped someone