0
通常與BLToolKit我通過以下方式獲取從DB數據:BLToolKit:它支持IQueryable嗎?
using (DbManager db = new MyDbManager())
{
IList<MyObjects> objects = db
.SetCommand(query)//sometimes with additional parameters
.ExecuteList<MyObjects>()
;
}
我想有能力做以下:
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
;
}
是可能的解決辦法與修改一部開拓創新查詢-string(修改WHERE部分),但有時它很複雜。
有沒有簡單的方法可以做到這一點?
謝謝。任何想法都歡迎!
太棒了!真棒!真棒! – Budda 2011-01-06 19:51:42