How to get max value of a column using Entity Framework? December 25, 2022 by Tarik Try this int maxAge = context.Persons.Max(p => p.Age); And make sure you have using System.Linq; at the top of your file