Usually with BLToolKit I fetch data from DB in the following way:
using ( DbManager db = new MyDbManager() )
{
IList<MyObjects> objects = db
.SetCommand(query)//sometimes with additional parameters
.ExecuteList<MyObjects>()
;
}
I would like to have ability to do the following:
using ( DbManager db = new MyDbManager() )
{
IQueryable<MyObjects> qObjs = db
.SetCommand(query)//sometimes with additional parameters
.ExecuteQuery<MyObjects>()// here I don't want query actually to be executed
;
// ... another logic, that could pass qObj into other part of program
IList<MyObjects> objects = qObjs
.Where(obj=>obj.SomeValue>=SomeLimit) // here I want to put additional filters
.ExecuteList() // and only after that I wan't to execute query and fetch results
;
}
It is possible to workaround that with modifying orignal query-string (modify WHERE part), but sometimes it is pretty complicated.
Is there any easy way to do that?
Thanks. Any thoughts are welcome!