title: How to get max value of a column using Entity Framework?
body: <p>To get maximum value of a column that contains integer, I can use the following T-SQL comand</p>
  
  <pre><code>SELECT MAX(expression )
  FROM tables
  WHERE predicates;
  </code></pre>
  
  <p>Is it possible to obtain the same result with Entity Framework.</p>
  
  <p>Let's say I have the following model</p>
  
  <pre><code>public class Person
  {
    public int PersonID { get; set; }
    public int Name { get; set; }
    public int Age { get; set; }
  }
  </code></pre>
  
  <p>How do I get the oldest person's age?</p>
  
  <pre><code>int maxAge = context.Persons.?
  </code></pre>