title: Refactor code to make more generic method
body: <p>I want to try and refactor this method a bit better while I am having some difficulty in understand the async I have a web  api2 project which I use my data access layer to share to a phone app. I am not sure if I have the syntax correct I am using a xamrian shared library here in a xamrian forms app.</p>
  
  <p>I will have various methods link get clients which will have the end point API/clients but obv their return type would be different.</p>
  
  <p>How would one make the below work well with a list view say.</p>
  
  <p>How would I consume the below method as well , what is general practise to then store the jobs locally in sql lite.</p>
  
  <pre><code>public string BaseUrl { get; set; }
  public string EndPoint { get; set; }
  </code></pre>
  
  <p>Lets go out to the web service and grab the job list.</p>
  
  <pre><code>public async List&lt;Job&gt; GetJSON()
  {
          List&lt;Job&gt; rootObject = new List&lt;Job&gt;();
  
          try
          {
              var client = new System.Net.Http.HttpClient();
              var response = await client.GetAsync("http://myinternaliis/api/job");
              string json = await response.Content.ReadAsStringAsync();
               if (json != "")
              {
                  rootObject = JsonConvert.DeserializeObject&lt; List&lt;Job&gt;&gt;(json);
              }
  
          }
          catch (InvalidCastException e)
          {
              throw e;
          }
          return await rootObject;
  
   }
  </code></pre>
  
  <p>Thanks for help in improving my understanding.</p>