title: Type conversion error with async programming
body: <p>Can anyone tell me why this is not working?</p>
  
  <p>I have a method that looks like this:</p>
  
  <pre><code>public virtual async Task&lt;IList&lt;User&gt;&gt; GetAll()
  {
      return this.db.Users.Where(model =&gt; model.CompanyId.Equals(this.companyId, StringComparison.OrdinalIgnoreCase)).ToListAsync();
  }
  </code></pre>
  
  <p>when I try to compile my code I get an error stating:</p>
  
  <blockquote>
    <p>Error 10  Cannot implicitly convert type 'System.Threading.Tasks.Task>' to 'System.Collections.Generic.IList'. An explicit conversion exists (are you missing a cast?)  C:\Users\Jaymie\Documents\GitHub\Skipstone\Skipstone.Web\Repositories\UserRepository.cs 70  20  Skipstone.Web</p>
  </blockquote>
  
  <p>Yet directly under it I have this method:</p>
  
  <pre><code>public Task&lt;User&gt; FindByIdAsync(string userId)
  {
      return this.db.Users.Where(model =&gt; model.Id.Equals(userId, StringComparison.OrdinalIgnoreCase)).SingleOrDefaultAsync();
  }
  </code></pre>
  
  <p>which works fine.</p>
  
  <p>I think I can't see the wood for the trees so need someone else's eyes to help me out :)</p>