title: Can't Get $expand Working for a Single OData Entity With AsyncEntitySetController
body: <p>I am unable to use $expand on a single entity, but it works fine on a collection. I have the following asynchronous OData Web API controller:</p>
  
  <pre><code>public class AuthorController : AsyncEntitySetController&lt;Author, int&gt;
  {
      private readonly IAuthorRepository _AuthorRepo = new AuthorRepository();
  
      // GET odata/&lt;controller&gt;
      [Queryable]
      public override async Task&lt;IEnumerable&lt;Author&gt;&gt; Get()
      {
          var authors = await _AuthorRepo.GetAll();
          return authors.AsQueryable();
      }
  
      // GET odata/&lt;controller&gt;/5
      [Queryable]
      public async Task&lt;Author&gt; Get([FromODataUri]int key)
      {
          var author = await _AuthorRepo.GetById(key);
          return author;
      }
  }
  </code></pre>
  
  <p>Requesting the collection via <a href="https://api.acme.org/odata/Authors" rel="nofollow noreferrer">https://api.acme.org/odata/Authors</a> works, and so does expanding the authors' books via <a href="https://api.acme.org/odata/Authors" rel="nofollow noreferrer">https://api.acme.org/odata/Authors</a>?$expand=Books.</p>
  
  <p>However, attempting to expand a single entity using the Get method above that accepts a key parameter via <a href="https://api.acme.org/odata/Authors(1)" rel="nofollow noreferrer">https://api.acme.org/odata/Authors(1)</a>?$expand=Books yields the following error:</p>
  
  <blockquote>
    <p>Multiple actions were found that match the request:   Get on type
    AcmeApi.Controllers.AuthorsController  Get on type
    AcmeApi.Controllers.AuthorssController</p>
  </blockquote>
  
  <p>Upon reading the answer to <a href="https://stackoverflow.com/questions/19128009/web-api-odata-how-do-you-expand-on-a-single-entity">this question</a>, I tried returning a SingleResult by updating my second Get method to:</p>
  
  <pre><code>[Queryable]
  public SingleResult&lt;Account&gt; Get([FromODataUri]int key)
  {
      return SingleResult.Create&lt;Account&gt;(m_AccountRepo.GetById(key));
  }
  </code></pre>
  
  <p>But this results in the following compilation error:</p>
  
  <blockquote>
    <p>Argument 1: cannot convert from
    'System.Threading.Tasks.Task' to
    'System.Linq.IQueryable'</p>
  </blockquote>
  
  <p>The asynchronous GetById repository method is:</p>
  
  <pre><code>public async Task&lt;Author&gt; GetById(int id)
  {
      return await Task.Run(() =&gt; _Authors.Where(a =&gt; a.Id == id).SingleOrDefault());
  }
  </code></pre>
  
  <p>If returning a SingleResult is the way to get $expand to work for a single entity, what is the correct way to do so from an asynchronous controller?</p>