title: Async query in Entity Framework
body: <p>I'm in C# and using Entity Framework with a database-first approach, and I would like to do a query similar to this query but in an asynchronous way:</p>
  
  <pre><code>[Route("api/Tests/get/by/flight/{id}")]
  [ResponseType(typeof(Test))]
  public IHttpActionResult getByFlightTodayId(int id)
  {
      var testList = db.Tests.SqlQuery("Select * from Tests where Tests.AircraftId=@id", new SqlParameter("@id", id)).ToList&lt;Test&gt;();
      return Ok(testList);
  }
  </code></pre>
  
  <p>I have an example but it returns only one result - not an array.</p>
  
  <pre><code>[Route("api/Tests/get/by/flight/{id}")]
  [ResponseType(typeof(Test))]
  public async Task&lt;IHttpActionResult&gt; getByFlightId(int id)
  {
      Test test = await db.Tests.FirstAsync(r =&gt; r.AircraftId == id);
  
      if (test == null)
      {
          return NotFound();
      }
  
      return Ok(test);
  }
  </code></pre>
  
  <p>Also, I want to do an inner join query but I don't know how to do this.</p>
  
  <p>Can someone help me?</p>
  
  <p>Thanks</p>