title: Return an object other than a task from an async method
body: <p>How do I return an object other than Task from an async method?
  I do some async work in the method, but I need to return something other than Task or return the object inside a Task. I don't know.</p>
  
  <p>Code:</p>
  
  <pre><code>public async Task&lt;ICollection&lt;KeyValuePair&lt;int, IServiceProvider&gt;&gt;&gt; GetGroupedSearchStrings(int shopId)
  {
      ICollection&lt;KeyValuePair&lt;int, ISearchString&gt;&gt; result = new Collection&lt;KeyValuePair&lt;int, ISearchString&gt;&gt;();
      IEnumerable&lt;ISearchString&gt; ss = await ShopsExpressions.SearchString(this.Worker.GetRepo&lt;SearchString&gt;().DbSet).Where(s =&gt; s.Active &amp;&amp; s.ShopId.Equals(shopId)).OrderBy(s =&gt; s.DateCreated).ToListAsync();
  
      result.Add(new KeyValuePair&lt;int, ISearchString&gt;(1, DEMO));
  
      return result;
  }
  </code></pre>