Approach One:
InstanceContext callbackContext = new InstanceContext(new NameService());
DuplexChannelFactory<IMyService> factory = new DuplexChannelFactory<IMyService>(typeof(callbackContext), binding, address);
IMyService myService = factory.CreateChannel();Approach Two
InstanceContext callbackContext = new InstanceContext(new NameService());
DuplexChannelFactory<IMyService> factory = new DuplexChannelFactory<IMyService>(typeof(NameService), binding, address);
IMyService myService = factory.CreateChannel(callbackContext);
本文介绍了使用 DuplexChannelFactory 创建 IMyService 接口实例的两种不同方法。第一种方法通过直接指定回调上下文创建通道;第二种方法则是将回调上下文作为参数传递给 CreateChannel 方法。

434

被折叠的 条评论
为什么被折叠?



