title: How to register Interface<T> with T is an interface in Structuremap
body: <p>I have an interface</p>
  <pre><code>    IFinancialMarketRepository&lt;IFinancialMarket&gt; 
  </code></pre>
  <p>and the <code>FinancialMarketRepository</code> is</p>
  <pre><code>    FinancialMarketRepository&lt;IFinancialMarket&gt;
  </code></pre>
  <p>When I register that by StructureMap with code</p>
  <pre><code>    x.For(typeof(IFinancialMarketRepository&lt;&gt;)).Use(typeof(FinancialMarketRepository&lt;&gt;));
  </code></pre>
  <p>I got a message</p>
  <blockquote>
  <p>&quot;No default Instance is registered and cannot be automatically determined for type <code>'IFinancialMarketRepository&lt;IFinancialMarket&gt;'</code></p>
  <p>There is no configuration specified for <code>IFinancialMarketRepository&lt;IFinancialMarket&gt;</code></p>
  </blockquote>
  <p>I also try with code:</p>
  <pre><code>    ObjectFactory.Container.Configure(expression =&gt; expression.Scan(scanner =&gt;
      {
          scanner.TheCallingAssembly();
          scanner.AddAllTypesOf(typeof(IFinancialMarketRepository&lt;&gt;));
          scanner.WithDefaultConventions();                  
      }));
  </code></pre>
  <p>But the error message still exist.</p>
  <p><strong>Update</strong></p>
  <p>Here is code that I define x:</p>
  <pre><code> ObjectFactory.Initialize(x =&gt;{
     x.For(typeof(IFinancialMarketRepository&lt;&gt;)).Use(typeof(FinancialMarketRepository&lt;&gt;));
  });
  </code></pre>