In most of the scenarios, We would like to invoke the WCF service asynchronously, especially if service takes a long execution time. If we are consuming the WCF service from WPF or Silverlight Application (or any other application) , We would not like to block the main thread by invoking the WCF service in a synchronous manner.
Traditionally, in a Async programming we have to separate the code for service invocation and result collection.Also, there is a overhead of context synchronization if your service call is on worker thread and UI running on Main thread (As in WPF applications). Although there are alternatives to fix the issues, C# 5.0 provides a clean alternative.
C# 5.0 Async and Await feature provides a cleaner way to provide asynchronous effect while code resembles more or less like an synchronous call. The heavy lifting and context synchronization overhead will be taken care by the C# 5.0 compiler.
In this example I will demonstrate, how to invoke a WCF service using C#5.0 Async and Await feature.