RIA Service 与LOB(Line of Business)相互关联
- 在LOB中分多少层,RIA在其中的作用?
- 准备服务端服务和服务端的数据处理
- 创建一个没有连接WCF RIA Services的SilverLight客户端程序,然后把服务端和客户端连接起来。
- 关注DomainService class 一个对于WCF RIAServices非常重要的服务端的类
- 使用可视设计器创建一个UI并自动连接到服务端
- 以MVVM的模式重构程序,避免自动创建UIs所带来的问题
- 实现Create、Read、Update、Delete(CRUD)
- Validation
- 在客户端创建一个查询,在服务端执行
- ObjectContext,和数据库的交互都通过这个
- partial关键字允许在不同的文件中定义类,分割定义。
- Metadata可以用来定义Validation Rules
/包含生成 Silverlight 客户端应用程序所需的类、枚举´和¨ª接¨®口¨²,ê?这a些?应®|用®?程¨¬序¨°可¨¦用®?于®¨²访¤?问¨º分¤?布?式º?应®|用®?程¨¬序¨°。¡ê
System.ServiceModel.EndpointAddress add=new System.ServiceModel.EndpointAddress(new Uri("http://localhost/silverlightsamples/service1"));
System.ServiceModel.EndpointAddress add1 = new System.ServiceModel.EndpointAddress("http://localhost:" +
HtmlPage.Document.DocumentUri.Port + "/TypeShareing.Web/TestService.svc");
TestServiceClient proxy1 = new TestServiceClient();
proxy1.Endpoint.Address = add1;
proxy1.GetCustomerCompleted += GetCustomerCompleted1;
proxy1.OpenAsync(0);
}
private void GetCustomerCompleted1(object sender,GetCustomerCompletedEventArgs e)
{
Customer customer = e.Result;
MessageBox.Show(customer.GetFullName());
}