I found this question http://stackoverflow.com/questions/343899/how-to-cache-data-in-a-mvc-application and I'm wondering about being able to use this method with IQueryable data.
Public Function GetUsers() As IQueryable(Of User) Implements IUserRepository.GetUsers
Dim users = (From u In dc.Users
Select u)
Return users.AsQueryable
End Function
Can I change this to
Public Function GetUsers() As IQueryable(Of User) Implements IUserRepository.GetUsers
Dim users = Cache("users")
If users Is Nothing Then
users = (From u In dc.Users
Select u)
Cache("users") = users
End If
Return users.AsQueryable
End Function