This is a migrated thread and some comments may be shown as answers.

max

1 Answer 30 Views
Databases and Data Types
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
amir sherafatian
Top achievements
Rank 1
amir sherafatian asked on 29 Sep 2009, 11:05 AM
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 ?

1 Answer, 1 is accepted

Sort by
0
Zoran
Telerik team
answered on 30 Sep 2009, 07:02 AM
Hi amir sherafatian,

Yes you are right, these kind of queries are not fully processed on the database server in the current official version of OpenAccess. However there have been a lot of Linq improvements on our product lately and pushing Min,Max,Count etc. to the server are part of those. You will be able to use this functionality as soon as the next official OpenAccess release or internal build. Thank you for your patience.

Greetings,
Zoran
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Databases and Data Types
Asked by
amir sherafatian
Top achievements
Rank 1
Answers by
Zoran
Telerik team
Share this question
or