title: How to return an action from a function?
body: <p>I am new to this (and nothing I've read or tried has worked). </p>
  
  <p>I wish to use a function of form:</p>
  
  <pre><code> Func&lt;string, Action&gt; getAction = (editingmark) =&gt;
      {
          Action doit;
          switch (editingmark)
          {
              case "&gt;":
                  doit = editRx;    &lt;--ERROR OCCURS HERE.
                  break;
          }
          return doit;
      };
  </code></pre>
  
  <p>where editRx has the form:</p>
  
  <pre><code>Action editRx = () =&gt;
      {
      };
  </code></pre>
  
  <p>and I get:</p>
  
  <p><em>A field initializer cannot reference the non-static field, method, or property ...editRx</em></p>
  
  <p>What to do? (and is there a better way?)</p>
  
  <p>Thanks for all help.</p>