title: pass lambda expression as callback to an extension method and pass parameter to it
body: <p>I am trying to understand the concept of lambda expression,extension method,Linq and IEnumerable interface. You can guess that i am farely new to c sharp.Here i've come up with a problem which will incorporate all the above mentioned concepts . Here i have a list which contain three object.I want to change the name property of a Students object in a specified index .I wrote an extension method which accept a callback function.Callback function accepts an integer index and a new Name string. It should change the name property and return the object .But my code failed to do so as i am not sure how to pass parameter to Func callback in extension method.I am in need of some assistant to understand the problem and fix errors from my code ?</p>
  
  <pre><code>class Program
  {
      static void Main(string[] args)
      {
          List&lt;Students&gt; students = new List&lt;Students&gt;();
  
          students.Add(new Students(111443, "sakib"));
          students.Add(new Students(111445, "zami"));
          students.Add(new Students(111444, "habib"));
  
          var student = students.First();
  
          var changed1 = students.Change((int num,string newname) =&gt; { return students[num].s_name = newname;});
  
  
      }
  }
  
  public class Students
  {
      public int s_id;
  
      public string s_name;
  
      public Students(int id, string name)
      {
          this.s_id = id;
  
          this.s_name = name;
      }
  }
  
  public static class LinqHelper
  {
      public static IEnumerable&lt;T&gt; Change&lt;T&gt; (this IEnumerable&lt;T&gt; source, Func&lt;int,string,T&gt; callback)
      {
          var myList = new List&lt;Students&gt;();
  
          myList.Add(callback(1,"zami")); // i was passing parameter here which is not so helpful i guess !
  
          return myList;
  
      }
  }
  </code></pre>