I have an object with a list of datetime items. I have another list that has a property
I want to select the datetime items in the list that is in the object only if it matches one of the items in the other list. I am able to get the items but I don’t know how to basically write “if the current item matches any of the items in this list”.
The LINQ so far is like
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?
thanks
EDIT
I need this done in this LINQ as this is only a section of the over all LINQ.
EDIT
If must be a Linq query, and you don’t want to use Intersect, try this:
or