I've a (wcf data services) serviceoperation on server side:
<WebGet()> _
Public Function GetProjectsToAdmin() As IQueryable(Of Project)
Dim ctx As SilverProjectEntities = Me.CurrentDataSource
Dim query = From p In ctx.Project
From u In p.Administrators
Where u.UserID = HttpContext.Current.User.Identity.Name
Select p
Return query
End Function
A breakpoint at the line "Return query" shows that the project entities contain all related entities of administrators. But the silverlight client only receives the project entities without the administrator entites. Here is the client code:
Private Sub LoadProjectCompleted(ByVal result As IAsyncResult)
Dim dsr As DataServiceResponse
Try
dsr = ctx.EndExecuteBatch(result)
For Each resp As QueryOperationResponse In dsr
If resp.Error IsNot Nothing Then Throw resp.Error
If result.AsyncState = 0 AndAlso TypeOf resp Is QueryOperationResponse(Of Project) Then
ReferenceProject.ItemsSource = CType(resp, QueryOperationResponse(Of Project))
End If
Next
Catch ex As Exception
MessageBox.Show(ex.Message.ToString)
End Try
End Sub
What is wrong with my code?