title: How to select a row(object) based on max of a field Entity Framework 4.1
body: <p>am trying to get a row (object) based on the max of <code>RollNumber</code> which is a long <code>Datatype field</code>. i expect it to return a null object in case there isn't any so i used <code>SingleorDefault</code>.But it seems my query is all wrong(work in progress on linq here).
  here is the query:</p>
  
  <pre><code>SchoolContextExpress db = new SchoolContextExpress();
          Profile profile = db.Profiles.Where(p =&gt; p.RollNumber == db.Profiles.Max(r=&gt;r.RollNumber)).SingleOrDefault();
  </code></pre>
  
  <p>thanks for reading this.</p>