title: Accessing a non-static member via Lazy<T> or any lambda expression
body: <p>I have this code:</p>
  
  <pre><code>public class MyClass
  {
      public int X { get; set; }
      public int Y { get; set; }
  
      private Lazy&lt;int&gt; lazyGetSum = new Lazy&lt;int&gt;(new Func&lt;int&gt;(() =&gt; X + Y));
      public int Sum{ get { return lazyGetSum.Value; } }
  
  }
  </code></pre>
  
  <p>Gives me this error:</p>
  
  <blockquote>
    <p>A field initializer cannot reference the non-static field, method, or
    property.</p>
  </blockquote>
  
  <p>I think it is very reasonable to access a non-static member via lazy, how to do this?</p>
  
  <p><strong>* EDIT *</strong></p>
  
  <p>The accepted answer solves the problem perfectly, but to see the detailed and in-depth -as always- reason of the problem you can read <a href="https://stackoverflow.com/a/14029456/283787">Joh Skeet's answer</a>.</p>