我有一個包含日期時間項目列表的對象。我有另一個列表,其中有一個屬性我將如何使用LINQ做以下邏輯
我想在列表中選擇對象中的日期時間項目,只有當它匹配另一個列表中的其中一個項目時。我能夠獲得項目,但我不知道如何基本寫入「如果當前項目與此列表中的任何項目匹配」。
的LINQ到目前爲止就像
from item in ObjectWithList.DateList
from compareItem in OtherDateTimeList
where item = //Here is there I run into trouble, how would I loop through the compareitems?
感謝
編輯 我需要在這LINQ完成這件事,因爲這僅僅是一個在所有LINQ的部分。
我需要在此LINQ中完成此操作,因爲這只是整個LINQ的一部分。 –