title: Return data from linked table
body: <p>I have 3 tables</p>
  <p>table 1 = user table</p>
  <p>table 2 = staff table</p>
  <p>table 3 = userStaff table</p>
  <p>userStaff table is the join table that connects the user and staff table.</p>
  <pre><code>user Table
   
  id | firstName  | password
  ---------------------------
  2  | UserOne    | hashed
  
  
  
  staff Table
  
  id | firstName  | lastName
  ---------------------------
  3  | sally      | jones
  
  
  userStaff Table
  
  userID | staffID
  ---------------------------
  2      | 3
  </code></pre>
  <p>I have created a method that inputs the user id and it should return back the staff table corresponding to the staffId linked to the userID. In this case, I want to insert the user id of 2 and get back the information of staff id 3, therefore receiving back &quot; id = 3, firstName = Sally, lastName = jones&quot;.</p>
  <p>This is the code I tried to use</p>
  <pre><code>public async Task&lt;UserStaff&gt; GetUserLinkStaff(int id)
  {
      var staff = await _context.UserStaffs
      .FirstOrDefaultAsync(u =&gt; u.UserId == id)
      .Include(s =&gt; s.staffs);
  
      return staff;
  }
  </code></pre>
  <p>However, I get an error message which says &quot;Task' does not contain a definition for 'Include' and no accessible extension method 'Include' accepting a first argument of type 'Task' could be found (are you missing a using directive or an assembly reference?) [Schedular.API]csharp(CS1061)&quot;</p>
  <p>What is the correct LINQ query I should use?</p>