c# if 语句的简写格式

c# short hand formatting of if statement

我似乎想不出更简洁的写法

 if (isProcessed)
    returnresults = returnresults.FindAll(x => x.DateProcessed == null);
 else 
    returnresults = returnresults.FindAll(x => x.DateProcessed != null);

有人知道 shorthand 的写法吗?

我假设您的原始逻辑被颠倒了——如果 isProcessed 为真,您需要 .DateProcessednon-[=13 的对象=].

returnresults = returnresults.FindAll(x => (x.DateProcessed != null) == isProcessed);