0
我有以下情況:LINQ的NHibernate的 - 分隔查詢
與
var totalRecords = (from entry in invalidAccEntryRepository
select entry);
if (CustomerAccountInfoFilterActive)
{
totalRecords.Where(entry =>
entry.CustomerAccountInfo.CustomerAccountName == CustomerAccountName &&
entry.CustomerAccountInfo.CustomerAccountId == CustomerAccountId);
}
totalRecordsCount = totalRecords.Count();
第一查詢工作完全,但第二個查詢僅執行的唯一
var totalRecords = (from entry in invalidAccEntryRepository
select entry);
並忽略有條件添加的表達式。
任何人都知道問題可能是什麼?你需要更多信息嗎?
Thx提前!
非常感謝! – Chris 2009-08-27 13:28:14
克里斯沒問題。 :) – 2009-08-27 13:38:20