我正在使用适用于WCF服务的Silverlight应用程序。在我的浏览器中加载服务元数据时,我注意到它提供了以下代码:Silverlight - 关闭服务
class Test
{
static void Main()
{
myServiceClient client = new myServiceClient();
// Use the 'client' variable to call operations on the service.
// Always close the client.
client.Close();
}
}
最后一行显示“始终关闭客户端”。我的问题是,什么时候应该关闭Silverlight应用程序中的客户端?如果在调用“[MyServiceOperation] Async”之后关闭它,还是应该在“[MyServiceOperation] Completed”事件处理程序中关闭它?
在异步场景中使用时,谢谢你,