title: StructureMap: Configure concrete classes at run time?
body: <p>I know that Concrete Types can be configured with Structure Map the following way:</p>
  
  <pre><code>ForRequestedType&lt;Rule&gt;().TheDefault.Is.Object(new ColorRule("Green"));
  </code></pre>
  
  <p>This works if you know the type ahead of time.  I want to do it at run time, and there does not seem to be a way.  Can some one enlighten me?  What I want to do is something like the following:  (This appears to be not supported by structure map)</p>
  
  <pre><code>ForRequestedType(typeof(Rule)).TheDefault.Is.Object(new ColorRule("Green"));
  </code></pre>
  
  <p>The reason for this is because I'm working on a wrapper for structure-map's configuration.  And I will not know the type ahead of time.  For the .Object(new ColorRule("Green")) I am going to be passing in a delegate instead, which would actually construct the object on request.</p>