title: Storing a Lambda Expression in a Variable
body: <p>I think my brain has become fried as i'm struggling to do something simple.  In my application i have the following code to configure Nhibernate (my issue is not specific to Nhibernate).</p>
  
  <pre><code>return Fluently.Configure()
      .ExposeConfiguration(c =&gt; {
          c.EventListeners.PostInsertEventListeners = new IPostInsertEventListener[] { new LoggingEventListener() };
          c.EventListeners.PostUpdateEventListeners = new IPostUpdateEventListener[] { new LoggingEventListener() };
     });
  </code></pre>
  
  <p>However I need to store the configuration (the stuff inside ExposeConfiguration) inside a private variable.  I can do the following:</p>
  
  <pre><code>return Fluently.Configure()
      .ExposeConfiguration(c =&gt; _configuration = c);
  </code></pre>
  
  <p>Where _configuration is a private variable.  But this doesn't add my extra configuration options (the EventListeners stuff).  I've played around with various things but i guess my lambda knowledge isn't as good as i thought.</p>
  
  <p>I'd appreciate your help.  Thanks</p>