我正在尝试通过我的 WCF 服务进行服务器端分页。我的代码仅获取 50 条记录并显示它们,但总数为 57 条记录,我无法分页到第二页查看它们。这是我的服务代码:
<OperationContract()>
Public Function QueryUsersForGroup(
ByVal authentication As AuthenticationArgs,
ByVal group As Guid,
ByVal skip As Integer,
ByVal take As Integer) As ResponseArgs(Of User())
Dim exception As ExceptionArgs = Nothing
If AuthenticationService.CheckPermissions(
authentication,
exception,
PermissionType.AdministerUserAccounts) Then
Dim model As CscModel = DataHelper.CreateModel()
Dim currentGroup = model.Groups.FirstOrDefault(Function(row) row.Id.Equals(group))
If currentGroup Is Nothing Then Return New ResponseArgs(Of User())(New User() {})
' This only returns 50 records since take is 50 from my callback
Return New ResponseArgs(Of User())(currentGroup.Users.Ship(skip).Take(take).ToArray())
Else
Return New ResponseArgs(Of User())(exception)
End If
End Function
我怎样才能通过记录的总数以及一次仅显示的 50 条记录?