title: Add unknown parameter to a Func inside a generic method
body: <p>I have looked at many resources online but I think this is something not possible or I am approaching it from the wrong angle.</p>
  
  <p>I am generating a list of ids from a child table and determining if the foreign key id in the parent table contains in the list of child ids. e.g. j => !ids.Contains(j.InvestorId). The code below will not compile as whereFilter can not take a parameter but you can see the effect I would like. </p>
  
  <p>Hopefully, there is a way instead of getting the ids beforehand and passing in an additional parameter to whereFilter.</p>
  
  <pre><code>public List&lt;int&gt; ValidateReferentialIntegrity&lt;TChild, TParent&gt;(string childFilePath, 
      string parentFilePath, 
      Func&lt;TParent, int, bool&gt; whereFilter, 
      Func&lt;TParent, int&gt; selector) 
  {
      var childList = ReadCsvFile&lt;TChild&gt;(typeof(TChild).Name, childFilePath);
      var parentList = ReadCsvFile&lt;TParent&gt;(typeof(TParent).Name, parentFilePath);
  
      var ids = childList.Select(s =&gt; (int)s.GetId()).ToList();
      var unidentifiableIds = parentList.Where(whereFilter(ids))
          .Select(selector).ToList();
      return unidentifiableIds;
  }
  </code></pre>