title: Async, RIA Service with Microsoft AsyncTargetingPack
body: <p>I have installed the Microsoft AsyncTargetingPack in order to use async/await in specific RIA invoke operations.
  I also read a lot about the implementation and some articls about building extensions for RIA data source from Kyle McClellan &amp; Oren Beeri[Using the new Async framework with RIA][1][1]: <a href="https://zormim.wordpress.com/2011/01/06/using-the-new-async-framework-with-ria/" rel="nofollow">https://zormim.wordpress.com/2011/01/06/using-the-new-async-framework-with-ria/</a></p>
  
  <p>I used his extension as follows:
  This <em>async</em> method will <em>await</em> the RIA <strong>invoke</strong> method to return the result to the caller either true / false.</p>
  
  <pre><code>public async Task&lt;bool&gt; CheckAccountDuplicates(string name, string id)
  {
  bool ret = false;
  Debug.WriteLine("In func");
  ret = await Context.InvokeAsync(() =&gt; Context.AccountNameExists(name, id));
  Debug.WriteLine(ret);
  return ret;
  }
  </code></pre>
  
  <p>The caller is another method  as follows:</p>
  
  <pre><code>public bool SaveRecs(ObservableCollection&lt;Acc&gt; accList)
  {
      int i = 0;
  
      foreach (Acc item in accList)
      {
          if (CheckAccountDuplicates(item.name, item.id)) continue;
          item.id = MaxID + i;
          Context.Accs.Add(item);
          i++;
      }
      return Commit();
  }
  </code></pre>
  
  <p>as you can see this method needs to make sure that Acc 'name' does not exist before attempting to add it to the context.</p>
  
  <p>The problem is that the debug write the value "In Func" once and the application halts ...!!! 
  no response at all.</p>
  
  <p>What am I doing wrong ??</p>