How can I use async/await to call a webservice?
Assuming that loginAsync returns void, and loginCmpleted event fires when login is done, this is called the Event-based Asynchronous Pattern, or EAP. To convert EAP to await/async, consult Tasks and the Event-based Asynchronous Pattern. In particular, you’ll want to make use of the TaskCompletionSource to convert the event-based model to a Task-based model. Once you’ve … Read more