title: Entity Framework Query with MAX
body: <p>I've been banging my head against the wall trying to translate a simple SQL Query into EF query..</p>
  
  <p>Can anyone help please.. Following is the query I am trying to translate.</p>
  
  <pre><code>SELECT p.[UniqueId]
    ,p.[CAI]
    ,p.[HRGuid]
    ,p.[FullName]
    ,p.[Email]
    ,a.*
  FROM [Participant] p
  INNER JOIN 
  (
      Select * FROM Assignment where assignmentNumber = 
      (Select MAX(AssignmentNumber)FROM 
      Assignment GROUP BY UniqueId)
  ) a
  ON p.UniqueId = a.UniqueId
  </code></pre>
  
  <p>Basically I'm trying to get Participant along with their latest assignment. </p>