Where Not In OR Except simulation of SQL in LINQ to Object(C#)

Posted by Thinking on Stack Overflow See other posts from Stack Overflow or by Thinking
Published on 2010-04-15T09:35:05Z Indexed on 2010/04/15 9:43 UTC
Read the original article Hit count: 183

Filed under:
|

Suppose I have two lists that holds the list of source file names and destination file names respectively.

The Sourcefilenamelist has files as 1.txt, 2.txt,3.txt, 4.txt

while the Destinaitonlist has 1.txt,2.txt.

I ned to write a linq query to find out which files are in SourceList that are absent in DestinationFile list.

e.g. here the out put will be 3.txt and 4.txt. I have done this by a foreach statement.. but now I want to do the same by using LINQ(C#).

Help needed.

Thanks

© Stack Overflow or respective owner

Related posts about c#

Related posts about LINQ