I have looked here :
LINQ To SQL exception: Local sequence cannot be used in LINQ to SQL implementation of query operators except the Contains operator
and here :
LINQ to Populate a range
but I can’t figure this one out. I have based my Task Manager on the NerdDinner project. Instead of FindUpcommingDinners I have a method below :
Public Function FindAllTeamTasks(ByVal TeamRole As String) As IQueryable(Of Task) Implements ITaskRepository.FindAllTeamTasks
Return From task In db.Tasks
Join usrs In System.Web.Security.Roles.GetUsersInRole(TeamRole)
On task.TaskAssignedToID Equals usrs
Order By task.InsertDateTime _
Select task
End Function
When the result is passed into the Paginatedlist as source it errors with the “Local sequence cannot …” error. The answer might be here as well but I can’t figure it out. Please help.
ASP.NET MVC2 LINQ – Repository pattern, where should the pagination code go?
You can’t use the result of
GetUsersInRole()in a join to a database table via LINQ to SQL. You can try this instead: