title: Azure Mobile App - UpdateAsync - waiting for activation "Error"
body: <p>I have two projects</p>
  
  <p>First is  <strong>Mobile App with Xamarin.Forms</strong> </p>
  
  <p>Second is <strong>Windows Form Application</strong></p>
  
  <p>and both have the same API that was created using <strong>Azure Mobile App.</strong></p>
  
  <p><strong>in Windows form</strong> 
  when I'm trying to update a row in the database with a.Net HttpClient using the following code : </p>
  
  <pre><code>private void BtnUpdateUser_Click(object sender, EventArgs e)
      {
          UserRepository userRepository = new UserRepository();
          var user = userRepository.GetAllUsers().FirstOrDefault(w =&gt; w.UserId == 1)
  
          user.UserName = "UpdateUserName";
  
          var result = userRepository.UpdateUser(user.Id, user);
      }
  </code></pre>
  
  <p><strong>In UserRepository class</strong> I have a method called <strong>UpdateUser</strong></p>
  
  <pre><code>public User UpdateUser(string id, User user)
      {
          var result = Task.Run(async () =&gt; await azureServices.UpdateAsync(id, user)).Result;
          return result;
      }
  </code></pre>
  
  <p><strong>In AzureServices class</strong> I have a method called <strong>UpdateAsync</strong> </p>
  
  <pre><code>public async Task&lt;T&gt; UpdateAsync(string id, T instance)
      {
  
          var Uri= new Uri(baseAddress + id + zumoAddition); //"http://localhost:55040/tables/User/48D68C86-6EA6-4C25-AA33-223FC9A27959?zumo-api-version=2.0.0
          var content = JsonConvert.SerializeObject(instance);
          await _httpClient.PatchAsync(Uri, new StringContent(content, Encoding.UTF8, "application/json"));
  
          return instance;
      }
  </code></pre>
  
  <p><strong>PatchAsync is an <a href="https://stackoverflow.com/a/29772349/4977870">extension method</a></strong> to do a <code>PATCH</code> request with the <code>Windows.Web.Http.HttpClient</code> </p>
  
  <pre><code>public static async Task&lt;HttpResponseMessage&gt; PatchAsync(this HttpClient Client, Uri requestUri, HttpContent contnet)
      {
  
          var method = new HttpMethod("PATCH");
          var httpRequestMessage = new HttpRequestMessage(method, requestUri)
          {
              Content = contnet
          };
  
          var httpResponseMessage = new HttpResponseMessage();
          try
          {
              httpResponseMessage = await Client.SendAsync(httpRequestMessage);
          }
          catch (TaskCanceledException e)
          {
              Debug.WriteLine("Error: " + e.ToString());
          }
          return httpResponseMessage;
      }
  </code></pre>
  
  <p>in this line <code>httpResponseMessage = await Client.SendAsync(httpRequestMessage);</code> I get this error:</p>
  
  <blockquote>
    <p><code>{StatusCode: 400, ReasonPhrase: 'Bad Request', Version: 1.1, Content: System.Net.Http.StreamContent, Headers:
    {
      x-zumo-server-version: net-2.0.0
      X-SourceFiles: =?UTF-8?B?QzpcVXNlcnNcQW5hc1xEZXNrdG9wXFB1cmNoYXNlT3JkZXJzQmFja2VuZFxQdXJjaGFzZU9yZGVyc0JhY2tlbmRcdGFibGVzXFVzZXJcNTA1NzdBOTMtOEEzRi00OTEwLUJBOEYtM0MwMkMyOUFDMDUx?=
      Date: Thu, 29 Nov 2018 10:20:59 GMT
      Server: Microsoft-IIS/10.0
      X-Powered-By: ASP.NET
      Content-Length: 188
      Content-Type: application/json; charset=utf-8
    }}</code></p>
  </blockquote>
  
  <p><strong>In the backend</strong> I have a controller with a Patch method:</p>
  
  <pre><code>public Task&lt;User&gt; PatchUser(string id, Delta&lt;User&gt; patch)
      {
           return UpdateAsync(id, patch);
      }
  </code></pre>
  
  <p>when I try debugging the backend I get this: </p>
  
  <pre><code>Id = 179, Status = WaitingForActivation, Method = "{null}", Result = "{Not yet computed}"
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/JJSdK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JJSdK.png" alt="enter image description here"></a></p>
  
  <p>The question is:<strong>How I can get rid of this error and why it appears.</strong></p>