title: Where Not In OR Except simulation of SQL in LINQ to Objects
body: <p>Suppose I have two lists that holds the list of source  file names and destination file names respectively.</p>
  
  <p>The Sourcefilenamelist has files as 1.txt, 2.txt,3.txt, 4.txt </p>
  
  <p>while the Destinaitonlist has 1.txt,2.txt.</p>
  
  <p>I ned to write a linq query to find out which files are in SourceList that are absent in DestinationFile list.</p>
  
  <p>e.g. here the out put will be 3.txt and 4.txt.
  I have done this by a <code>foreach</code> statement. but now I want to do the same by using LINQ(C#).</p>
  
  <p>Edit:</p>
  
  <p>My Code is </p>
  
  <pre><code>List&lt;FileList&gt; sourceFileNames = new List&lt;FileList&gt;();
  
  sourceFileNames.Add(new FileList { FileNames = "1.txt" });
  sourceFileNames.Add(new FileList { FileNames = "2.txt" });
  sourceFileNames.Add(new FileList { FileNames = "3.txt" });
  sourceFileNames.Add(new FileList { FileNames = "4.txt" });
  
  List&lt;FileList&gt; destinationFileNames = new List&lt;FileList&gt;();
  destinationFileNames.Add(new FileList { FileNames = "1.txt" });
  destinationFileNames.Add(new FileList { FileNames = "2.txt" });
  
  IEnumerable&lt;FileList&gt; except =  sourceFileNames.Except(destinationFileNames);
  </code></pre>
  
  <p>And <code>Filelist</code> is a simple class with only one property fileNames of type string.</p>
  
  <pre><code>class FileList
      {
         public string FileNames { get; set; }
      }
  </code></pre>