title: Get the result of an async task in C#, Xamarin Forms
body: <p>I have the following lines of code which check if a device is registered in a database using an async method.</p>
  
  <pre><code>if (CrossConnectivity.Current.IsConnected)
  {
        return await App._deviceService.GetDevice(id);
  }
  </code></pre>
  
  <p>I had assumed that the await would have done just that - waited on GetDevice completing then return it's value, but on looking into I think that I need to use a callback if I want to get the actual result of the call so I can act upon it.</p>
  
  <p>Can anyone tell me if I'm going down the correct route with this?  Below is the called async task</p>
  
  <pre><code>public async Task&lt;bool&gt; GetDevice(string deviceID)
  {
      string url = Resources.Urls.dev + Resources.DeviceApi.Get + "?id=" + deviceID;
      HttpResponseMessage result;
      result = await App.HttpClientInstance().GetAsync(url);
  
      if (result.StatusCode == System.Net.HttpStatusCode.OK)
      {
          return true;
      }
      return false;
  }
  </code></pre>