【发布时间】:2013-06-25 12:06:59
【问题描述】:
我对定义我的服务的接口有疑问。我在 Silverlight 和 WPF 以及我的后端中使用相同的界面。
例如:
#if !SILVERLIGHT
[OperationContract(IsOneWay = false)]
SecurityOperationInfo LogonUser(string sessionId, string username, string password);
#else
[OperationContract(IsOneWay = false, AsyncPattern = true)]
IAsyncResult BeginLogonUser(string sessionId, string username, string password, AsyncCallback callback, object state);
SecurityOperationInfo EndLogonUser(IAsyncResult result);
#endif
问题是,我使用 Silverlight 中的接口(它运行良好)。现在我也想在WPF中使用Async方式,但是我不想在Server端实现Begin和End!但我的 WPF 项目正在链接到实现此接口的同一个 DLL!
有什么方法可以轻松实现吗?
【问题讨论】:
标签: c# wpf wcf asynchronous