Tuesday, December 18, 2012

DNN UserController.GetUsersByProfileProperty

Today while traversing through DNN code I found that method UserController.GetUsersByProfileProperty returns all available records if we pass -1 as pageIndex!

DNN handles pageIndex -1 at AspNetMembershipProvider class. Below is its implementation present in that class.

Public Overrides Function GetUsersByProfileProperty(ByVal portalId As Integer, ByVal propertyName As String, ByVal propertyValue As String, ByVal pageIndex As Integer, ByVal pageSize As Integer, ByRef totalRecords As Integer) As ArrayList
            If pageIndex = -1 Then
                pageIndex = 0
                pageSize = Integer.MaxValue
            End If

            Return UserController.FillUserCollection(portalId, dataProvider.GetUsersByProfileProperty(portalId, propertyName, propertyValue, pageIndex, pageSize), totalRecords)
        End Function

No comments:

Post a Comment