title: Compare two lists and save matching column to a separate list
body: <p>I parse in a file and save the results to a list in C#. I then parse all results of a DB query to another list. I want to compare the two lists for matches and save the results to another list to write an output file. I thought comparing the two lists was faster and better than running the query against the DB each time for each person since their is about 16k records in the file.</p>
  
  <p>List 1. List fileList  contains datatypes of: string personsName</p>
  
  <p>List 2. List DBresults contains datatypes of: string personsName, string address, string phoneNumber</p>
  
  <p>Trying to compare List 1 to List 2 to find matches and then send results to another list to write output.
  Their could be multiple results per person in List 2 so I need to find every instance.</p>
  
  <p>Started with a LINQ query like this but I'm no master at LINQ so I need some help.</p>
  
  <pre><code>var matches = fileList.Where(a=&gt;a.personsName == DBResults.where(s=&gt;s,personsName).toList();
  </code></pre>
  
  <p>I'm also open to other suggestions if you think you may have a faster way. I know IDctionarys and Hashtables are fast look up tables but I have three datatypes so I can't do a keyvaluepair.</p>