where task.RevisionDateTime > startDateTime_
&& task.RevisionDateTime <= endDateTime_
&& task.AutoAuditNotes.ToLower() != auditString.ToLower()
&& (if(isStaging_) condition1 else condition2)
select task).ToList();
where 절 아래에 IF ELSE 문 && (if(isStaging_) condition1 else condition2)
이 있습니다. WHERE 절에 조건을 추가하면 어떻게 isStaging_
변수의 값을 방어 할 수 있습니까?LINQ WHERE 절의 IF ELSE 문
감사합니다.
'_isStaging' *이 (가) 조건이므로 약간의 혼란이 있다고 생각합니다. –
@ un-lucky 같은 조건은 없습니다 : &&'(if (isStaging_) task.IsCurrent == true else task.AutoAuditNotes.ToLower()! = auditString.ToLower()) ' – simpleProgrammer
isStaging_ 그렇지 않으면 condition2가됩니다. – Kinetic