title: Reference a function in a class
body: <p>I want to create a class with references to functions to run.
  Example code which does not create a reference but runs the function upon creation</p>
  <pre><code>public class Jobs
  {
      public List&lt;Job&gt; jobs;
  
      public Jobs()
      {
          jobs = new List&lt;Job&gt;()
          {
              new Job()
              {
                  name = &quot;Job 1&quot;,
                  job =  func1() // This runs the function, how do I create a reference to run it later in RunJobs?
              },
              new Job()
              {
                  name = &quot;Job 2&quot;,
                  job =  func1()
              }
          };
  
      }
      
  
      private async Task func1()
      {
          // do some stuff    
      }
      private async Task func2()
      {
          // do some other stuff    
      }
  
      public void RunJobs()
      {
          foreach(Job job in jobs) // Iterating through jobs
          {
              Console.WriteLine(job.name);
              job.job(); // I want to run the referenced function here
          }
      }
  
  }
  
  public class Job
  {
      public string name;        
      public Task job; 
  
  }
  </code></pre>
  <p>How can I reference func1() and func2() and run them by calling a method in the class when iterating through Jobs.</p>