title: What is the good and effective pattern to run asynchronous operation in WebApi controller?
body: <p>I' am developing a WebApi with the latest ASP.Net 5 RC1. The data provider is a third-party WCF service. I only have the contract (shipped as a dll which contains the service interface) and I want to call service operation asynchronously but that wcf service does not provide async operations. So I just try to figure out the right pattern I should use. So currently, the service client class looks like this (MyServiceClient : IMyServiceClient):</p>
  
  <pre><code>ChannelFactory&lt;IServiceInterface&gt; channelFactory;
  
  ...
  
  public IResult DoAServiceCall(object param)
  {
       var channel = channelFactory.CreateChannel();
       return channel.DoSomething(new Request() {Param = param});
  }
  
  public async Task&lt;IResult&gt; DoAServiceCallAsync(object param)
  {
      var result = await Task.Run(() =&gt; DoAServiceCall(param));
      return result;
  }
  </code></pre>
  
  <p>And the WebApi controller is like this:</p>
  
  <pre><code>public class SampleController : Controller
  {
      private IMyServiceClient serviceClient;
  
      public SampleController(IMyServiceClient serviceClient) 
      {
          this.serviceClient = serviceClient
      }
  
      [HttpGet]
      [Route("api/getsomething")]
      public async Task&lt;IResult&gt; Get(int p)
      {
          return await serviceClient.DoAServiceCallAsync(p);
      }
  }
  </code></pre>
  
  <p>Is this a good pattern to do an asynchronous service call? Or what is the good and effective implementation of this case?</p>
  
  <p>Thank you in advance.</p>