0
분리 된 쿼리 :Linq를하려면 NHibernate에 - 나는 다음과 같은 상황에있어
var totalRecords = (from entry in invalidAccEntryRepository
select entry).Where(entry =>
entry.CustomerAccountInfo.CustomerAccountName == CustomerAccountName &&
entry.CustomerAccountInfo.CustomerAccountId == CustomerAccountId).Count();
대
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
Chris는 문제 없습니다. :) –