title: How do I convert this subquery to Linq?
body: <p>I have following SQL query and trying to convert to LINQ</p>
  
  <pre><code>SELECT * 
  FROM 
      (SELECT 
           *, 
           ROW_NUMBER() OVER (PARTITION BY ScannedItemId 
                              ORDER BY ScannedDate DESC) AS rn 
       FROM ItemTracking) A  
  WHERE 
      A.rn = 1
      AND ScannedLoc = 1
  ORDER BY 
      ItemTrackingId DESC
  </code></pre>
  
  <p>This returns item ID that are in the location (<code>ScannedLoc</code>) currently.</p>
  
  <p>I'm new to LINQ and finding difficult putting other examples together especially subquery and <code>Row_Number</code> function.</p>
  
  <p>Could someone direct me to right path?</p>