But I have this one issue im running into.
Normally in my DAL methods, Ill start with a base IQuerable or generic "var" type object and then based on search/filter criteria I will append new query values on..
In one example I am startinging with this type of query:
using (ORMDBCONNECTION oDB = new ORMDBCONNECTION())
{
IQueryable<
APPLICATION
> qUery = (from app in oDB.Applications
join firm in oDB.Applicants on app.APPLICANT_ID equals firm.APPLICANT_ID
where app.EXPIRATION_DATE >= DateTime.Now
select app);
}
and then if the SEARCH options are supplied I may want to narrow down the query.. like so:
qUery = qUery.Where(c=>c.APP_TYPE == "SOMEVAL");
or if a sort expression is added from the Telerik grid.. Id like to do something like:
qUery = qUery.OrderBy(c => c.APPLICANT.NAME);
The Problem is, when I run the method (the .Where() or the .OrderBy())... it seems to be going through every object.. every thing runs fine and quick and as expected as long as I keep the criteria within the confines of that FIRST IQueryable expression... If I try to append to it or perform code like I listed above, it takes VERY VERY long and to me seems like its probably looping through every record.
Oddly enough, even though WHERE and OrderBy perform badly... the SKIP() method works fine and as expected.
like this: (works fine)
if (MAXROWS > 0) //Check to see if PAGING is required.. if so, only return needed rows.
{
qUery = qUery.Skip(STARTINDEX).Take(MAXROWS);
}
Is there something im missing about using .Where() and .OrderBy() with the Telerik ORM data Model?
Thanks in Advance to anyone here..
-Jesse