这个WCF RIA Silverlight教程的后续链接令人困惑

时间:2011-02-10 11:46:07

标签: silverlight

直到下面就可以了。

http://msdn.microsoft.com/en-us/library/ee796239(v=vs.91).aspx#Y2918

从下面的链接看,_customer上下文来自何处?

http://msdn.microsoft.com/en-us/library/ee707338(v=vs.91).aspx

1 个答案:

答案 0 :(得分:1)

以下是来自Walkthrough: Creating a RIA Services Solution的代码,其中定义了_customerContext。

Imports System.ServiceModel.DomainServices.Client
Imports RIAServicesExample.Web

Partial Public Class MainPage
    Inherits UserControl

    Private _customerContext As New CustomerDomainContext

    Public Sub New()
        InitializeComponent()

        Dim loadOp = Me._customerContext.Load(Me._customerContext.GetCustomersQuery())
        CustomerGrid.ItemsSource = loadOp.Entities
    End Sub

End Class