title: Fluent interface configuration with lambdas in C#
body: <p>Many open source projects use a Configuration class and lambda's to clarify configuring a complex object. Take <a href="http://readthedocs.org/docs/masstransit/en/develop/index.html" rel="noreferrer">Mass Transit</a> for example. A simple configuration would be like so.</p>
  
  <pre><code>Bus.Initialize(sbc =&gt;
          {
              sbc.UseMsmq();
              sbc.VerifyMsmqConfiguration();
              sbc.VerifyMsDtcConfiguration();
              sbc.UseMulticastSubscriptionClient();
              sbc.ReceiveFrom("msmq://localhost/test");
          });
  </code></pre>
  
  <p>When you hover over <code>Initialize</code> in Visual Studio it says the parameter for the method call is <code>Action&lt;ServiceBusConfigurator&gt;</code>. I was wondering if anyone could show a simple example of how to use this pattern on a class. I don't even know what to call this type of pattern and my "GoogleFu" is not working as of yet. In this particular case I realize the method is operating on a singleton pattern. But I am ok with it being an instance method on a class.</p>