title: Why is the "this" pointer null in a delegate?
body: <p>I have the following code (details removed for clarity):</p>
  
  <pre><code>    private abstract class Base&lt;TResult&gt; {
          private readonly System.Func&lt;TResult&gt; func = null;
  
          protected Base(System.Func&lt;TResult&gt; func) {
              this.func = func;
          }
  
          public TResult Execute() {
              return this.func();
          }
      }
  
      private class Derived : Base&lt;bool&gt; {
          public Derived(bool myValue) : base(delegate() { return this.MyValue(); }) {
              this.myValue = myValue;
          }
  
          private bool myValue = false;
          private bool MyValue() {
              return this.myValue; // The "this" pointer is null here...
          }
      }
  
      Derived d = new Derived(true);
      bool result = d.Execute(); // This results in a null reference pointer (commented above)
  </code></pre>
  
  <p>Any ideas?</p>
  
  <p>Thanks, Dave</p>