title: Effectively use async/await with ASP.NET Web API
body: <p>I am trying to make use of the <code>async/await</code> feature of ASP.NET in my Web API project. I am not very sure whether it will make any difference in performance of my Web API service. Please find below the workflow and sample code from my application.</p>
  
  <p><strong>Work Flow:</strong></p>
  
  <p>UI Application → Web API endpoint(controller) → Call method in Web API service layer → Call another external web service. (Here we have the DB interactions, etc.)</p>
  
  <p><strong>Controller:</strong></p>
  
  <pre><code>public async Task&lt;IHttpActionResult&gt; GetCountries()
  {
      var allCountrys = await CountryDataService.ReturnAllCountries();
  
      if (allCountrys.Success)
      {
          return Ok(allCountrys.Domain);
      }
  
      return InternalServerError();
  }
  </code></pre>
  
  <p><strong>Service Layer:</strong></p>
  
  <pre><code>public Task&lt;BackOfficeResponse&lt;List&lt;Country&gt;&gt;&gt; ReturnAllCountries()
  {
      var response = _service.Process&lt;List&lt;Country&gt;&gt;(BackOfficeEndpoint.CountryEndpoint, "returnCountries");
  
      return Task.FromResult(response);
  }
  </code></pre>
  
  <p>I tested the above code and is working. But I am not sure whether it is the correct usage of <code>async/await</code>. Please share your thoughts.</p>