TeamSiteDataContext
represents the runtime context of the data service.
When you add a reference to an OData-based service (listdata.svc
) using Add Service Reference dialog in Visual Studio, a representation of TeamSiteDataContext
entity container class that inherits from DataServiceContext is being generated.
Below is provided the converted to VB.Net example:
Sub Main()
Dim dc As New TeamSiteDataContext(New Uri("http://intranet/_vti_bin/listdata.svc"))
dc.Credentials = CredentialCache.DefaultNetworkCredentials
Dim result = From d In dc.Inventory Select New With { _
Key .Title = d.Title, _
Key .Description = d.Description, _
Key .Cost = d.Cost _
}
For Each d In result
Console.WriteLine(d)
Next
End Sub
References
Generating the Data Service Client Library (WCF Data Services)