This question is locked. New answers and comments are not allowed.
hi
i use this code to get max :
public int MaxDCGroups()
{
return scope.Extent<DCGroup>().Max(u => u.Id);
}
but i think this code at first fecth all the records of my DCGroup table and then get max,
i dont want fetch all records for get max , i want a query that execute on mssqlserver and return a one record that is the max in my table
what can i do for this and other same cases like count and min ?
i use this code to get max :
public int MaxDCGroups()
{
return scope.Extent<DCGroup>().Max(u => u.Id);
}
but i think this code at first fecth all the records of my DCGroup table and then get max,
i dont want fetch all records for get max , i want a query that execute on mssqlserver and return a one record that is the max in my table
what can i do for this and other same cases like count and min ?