title: Await operator never returns the result of the ExecuteAsync operation using Restsharp in C# .NET
body: <p>I have created a <em>C#</em> Restsharp client to make queries towards my API using synchronous calls. The synchronous calls work as they should, however my asynchronous calls never return anything. The await operator should suspend the evaluation of the enclosing async method until the asynchronous operation represented by its operand completes. When the asynchronous operation completes, the await operator returns the result of the operation. However, in my case, this never happends. I have searched through the whole of stack overflow now, but I cannot figure out why my async calls won't return anything. Can anyone spot what may cause the issues and how I can fix it? This is my setup:</p>
  <p><em>The client side method:</em></p>
  <pre><code>public class Objects{
  
      private readonly IRestClient _restClient;
  
      public Objects(IRestClient restClient)
      {
          _restClient = restClient;
      }
  
      public async Task&lt; List&lt;ObjectGet&gt; CreateObjects(List&lt;ObjectBase&gt;&gt; objects, Boolean createCdfFile = true)
      {
  
          var request = new RestRequest(&quot;/objects/&quot;, Method.POST) { RequestFormat = DataFormat.Json };
  
          var objectsJson = JsonConvert.SerializeObject(objects, Formatting.Indented);
          request.AddParameter(&quot;create_cdf_file&quot;, createCdfFile, ParameterType.QueryString)
                 .AddParameter(&quot;application/json&quot;, objectsJson, ParameterType.RequestBody);
  
          IRestResponse&lt;List&lt;ObjectGet&gt;&gt; response = await _restClient.ExecuteAsync&lt;List&lt;ObjectGet&gt;&gt;(request);
  
          return response.Data;
      }
  }
  </code></pre>
  <p><em>My synchronous call works:</em></p>
  <pre><code>var obj = _restClient.FetchAllObjects(filter).GetAwaiter().GetResult();
  </code></pre>
  <p><strong>returns :</strong>
  System.Collections.Generic.List1[RestsharpApiClient.model.ObjectWithRelationships]</p>
  <p><em>My asynchronous call executes, but..</em></p>
  <pre><code>var obj = _restClient.FetchAllObjects(filter);
  </code></pre>
  <p><strong>never returns anything</strong>:</p>
  <p>However, if run the async call before the synchronous call in sequence, they both return the right result:</p>
  <pre><code>var obj = _restClient.FetchAllObjects(filter);
  var objAsync = _restClient.FetchAllObjects(filter).GetAwaiter().GetResult();
  </code></pre>
  <p><strong>returns:</strong></p>
  <p>System.Collections.Generic.List1[RestsharpApiClient.model.ObjectWithRelationships] , System.Collections.Generic.List1[RestsharpApiClient.model.ObjectWithRelationships]</p>
  <p><strong>This is my projects file</strong></p>
  <pre><code>TargetFramework=netstandard2.0
  &lt;LangVersion&gt;8.0&lt;/LangVersion&gt;
  &quot;Newtonsoft.Json&quot; Version=&quot;12.0.3&quot;
  &quot;RestSharp&quot; Version=&quot;106.11.4&quot;
  </code></pre>
  <p><strong>ANY HELP WOULD BE VERY MUCH APPRECIATED</strong></p>