title: SQL's Rownumber with Linq-to-entities
body: <p>I am converting my project to use EF and also want to covert stored procedures into Linq-to-entities queries.  </p>
  
  <p>This my SQL query (simple version)  that I have trouble to convert:</p>
  
  <pre><code>SELECT 
         CategoryID, Title as CategoryTitle,Description, 
         LastProductTitle,LastProductAddedDate
  FROM
  (
      SELECT
          C.CategoryID, C.Title,C.Description, C.Section,
          P.Title as LastProductTitle, P.AddedDate as LastProductAddedDate,                                          
          ROW_NUMBER() OVER (PARTITION BY P.CategoryID ORDER BY P.AddedDate DESC) AS Num
  
      FROM 
           Categories C         
           LEFT JOIN Products P ON P.CategoryID = C.CategoryID
  ) OuterSelect
  
  WHERE 
       OuterSelect.Num = 1
  </code></pre>
  
  <p>In words: I want to return all Categories (from Categories table) and title and date of addition of the product (from Products table) that was added last to this category.</p>
  
  <p>How can I achieve this using Entity frame work query?<br>
  In most efficient way.</p>