title: C# List.Find method - how can I pass a value into the predicate?
body: <p>I can't work out how to do a "find" on a List I have based on use of a value that I'll pass in at run time.  If you see my below code, I want to be able to find the CustomClass in the List for which it's Path parameter is equal to X, where X will be defined at run time.  </p>
  
  <p>Any ideas how to do such a find on a List? Or is this not possible without writing an iterator and doing the find manually?  In which case perhaps there is a key'ed collection I should look at using instead?</p>
  
  <pre><code>   private List&lt;CustomClass&gt; files;
  
     public void someMethod()
    {
         Uri u= new Uri(www.test.com);
         CustomClass cc = this.files.find( matchesUri(u) );  // WON'T LET ME DO THIS
    }
  
     private static bool matchesUri(List&lt;CustomClass&gt; cc, Uri _u)
      {
          return cc.Path == _u;           }
  
  
  public class CustomClass
  {
      private Uri path;
  
      public Uri Path
      {
          get { return this.path; }
          set { this.path = value; }
      }
  }
  </code></pre>
  
  <p>PS.  I must admit I don't quite follow the predicate stuff in the doco at <a href="http://msdn.microsoft.com/en-us/library/x0b5b5bc.aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/x0b5b5bc.aspx</a></p>