开发者

Creating Async WCF operations in WCF +MVVM

I am trying to implement MVVM for my WPF application. I have WCF services for which I want to create a data Model. My WCF does not implement callbacks. I am having issues creating a Model for my Async WCF services.

Please provide me some sample on how to generate a function for a Asyn wcf service. Suppose I have a WCF operation GetOrderDet开发者_运维百科ails(DateTime startDate, DateTime endDate) Then how will I go about creating a Model function using the GetOrderDetailsCompleted and GetOrderDetailsAsync


This is a purely client-side WCF issue, and is handled by the service utility code generator.

When you 'Add Service Reference...' you are able to instruct the service utility to create asynchronous operations.

  • 'Add Service Reference...'
  • Click 'Advanced...'
  • In the Client section at the top, check the 'Generate asynchronous operations' box

The service operations will be created with asynchronous methods like OperationNameAsync(), and with additional events like OperationNameCompleted. For samples on how to call the service asynchronously, check MSDN.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜