title: C#, Updating a List using a delegate function as a filter
body: <p>I want to update a list of objects(mycapsule, has many other members) when a condition (pred) holds for one of its class members(value). Whenever I change something another thing fails, I'm newbie in C# and really confused.
  Can somebody fix my code: 
  In the best condition I only get get this error but I think many things are missing in my code </p>
  
  <pre><code>The type or namespace name `T' could not be found. Are you missing a using directive or an assembly reference?
  </code></pre>
  
  <p>here is my code</p>
  
  <pre><code>using System;
  using System.Collections.Generic ;
  namespace test
  {
      class MainClass
      {
          public static List&lt; mycapsule&lt;int,double&gt; &gt; sample=  new List&lt; mycapsule&lt;int,double&gt;&gt;();
          public static void Main (string[] args)
          {
  
              sample.Add(new mycapsule&lt;int,double&gt; {id=1 , value= 1.2});
              update(pred, 12.3);
          }
  
          public static bool pred(double x)
          {
              if (x==2.5) return true;
              return false;
          }
          public class mycapsule&lt;KT, T&gt;
          {
              public KT id {get ; set; } 
              public T value { get ; set; }
              public int p; // and more
  
          }    
  
          public bool update(Func&lt;T, bool&gt; predicate, T i)
          {
              foreach (var x in sample.FindAll(item =&gt; predicate(JustValue(item))) )
              {
                  x.value = i ;
              }
              return true ;
          }
  
  
  
          public T JustValue(mycapsule&lt;int,T&gt; i)
          {
              return i.value;
          }
  
      }
  }
  </code></pre>