I've got an IQueryable repository (admittedly this is the first time I've tried this) and I can't seem to get it to pull the correct data using Skip(1).Take(1)
Here's the repository
Public Function GetActivity() As IQueryable(Of ActivityLog) Implements IActivityLogRepository.GetActivity
Dim activity = (From a In dc.ActivityLogs
Order By a.ActivityDate Descending
Select a).AsQueryable
Return activity
End Function
And here's the Service
Public Function GetUsersLastActivity(ByVal UserID As Integer) As ActivityLog Implements IActivityLogService.GetUsersLastActivity
Return _ActivityLogRepository.GetActivity().Where(Function(a) a.UserID = UserID).Skip(1).Take(1)
End Function
The problem is that it's returning the FIRST record in the Order By clause and not the SECOND.
Can anyone tell me what I'm doing wrong here?