title: StructureMap object reload
body: <p>to simplify, I have an AppSettings:IAppSettings class which is initialized at start of the application:</p>
  
  <pre><code>ObjectFactory.Initialize(x =&gt;
  {
      x.Scan(scan =&gt; {
          scan.TheCallingAssembly();
  
          scan.WithDefaultConventions();
      });
      x.AddRegistry&lt;DataAccessRegistry&gt;();
      x.AddRegistry&lt;AuthorizationRegistry&gt;();
  
      x.For&lt;IAppSettings&gt;()
          .Use&lt;AppSettings&gt;()
          .Ctor&lt;Dictionary&lt;string, string&gt;&gt;()
              .Is(ctx =&gt;
              {
                  Dictionary&lt;string, string&gt; dict = new Dictionary&lt;string, string&gt;();
                  var sessionFactory = ctx.GetInstance&lt;ISessionFactory&gt;();
                  using (var session = sessionFactory.OpenSession())
                  using (var tx = session.BeginTransaction())
                  {
                      // query the SETTINGS table
                      foreach (Setting _setting in session.QueryOver&lt;Setting&gt;().List())
                      {
                          dict[_setting.Key] = _setting.Value;
                      }
                      tx.Commit();
                  }
                  return dict;
              });
  
      x.UseDefaultStructureMapConfigFile = false;
  });
  </code></pre>
  
  <p>So, when creating a class that requires settings, I simply use the following</p>
  
  <pre><code>public class AccessDataService {
      private IAppSettings settings;
  
      public AccessDataService(IAppSettings p_appSettings) {
          settings = p_appSettings;
      }
  ....
  }
  </code></pre>
  
  <p>and structuremap nicely injects the object into my instance of a class.</p>
  
  <p>However, I would like to be able to trigger database setting reload explicitly so I was wondering if there is a way to tell structuremap to purge all existing objects of AppSettings and recreate them, loading the settings from the DB again?</p>
  
  <p>Cheers</p>