最佳答案
要获得包含整数的列的最大值,可以使用以下 T-SQL 命令
SELECT MAX(expression )
FROM tables
WHERE predicates;
Is it possible to obtain the same result with Entity Framework.
假设我有以下模型
public class Person
{
public int PersonID { get; set; }
public int Name { get; set; }
public int Age { get; set; }
}
How do I get the oldest person's age?
int maxAge = context.Persons.?