title: StructureMap, Web Api 2, and IUserStore error
body: <p>I have just started experimenting with Web Api 2 and StructureMap, having installed StructureMap.MVC4 Nuget package. Everything seems to work fine until I tried to register a user. I got this error when this implementation of IHttpControllerActivator tried to instantiate a controller:</p>
  
  <pre><code>public class ServiceActivator : IHttpControllerActivator
      {
          public ServiceActivator(HttpConfiguration configuration) { }
  
          public IHttpController Create(HttpRequestMessage request
              , HttpControllerDescriptor controllerDescriptor, Type controllerType)
          {
              var controller = ObjectFactory.GetInstance(controllerType) as IHttpController;
              return controller;
          }
      }
  </code></pre>
  
  <p>The error I got was:</p>
  
  <pre><code>StructureMap Exception Code:  202
  No Default Instance defined for PluginFamily Microsoft.AspNet.Identity.IUserStore`1[[Microsoft.AspNet.Identity.EntityFramework.IdentityUser, Microsoft.AspNet.Identity.EntityFramework, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]], Microsoft.AspNet.Identity.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
  </code></pre>
  
  <p>I understand what the error is, but not entirely sure how to solve it. Is it correct to assume the default scanner in StructureMap could not find a default implementation of IUserStore? Here's the initialisation code I used:</p>
  
  <pre><code>ObjectFactory.Initialize(x =&gt; x.Scan(scan =&gt;
              {
                  scan.AssembliesFromApplicationBaseDirectory();
                  scan.WithDefaultConventions();
              }));
  </code></pre>
  
  <p>Any ideas please? Thanks.</p>
  
  <p>EDIT:
  I think I may have solved the initial issue using this:</p>
  
  <pre><code>x.For&lt;Microsoft.AspNet.Identity.IUserStore&lt;IdentityUser&gt;&gt;()
                      .Use&lt;UserStore&lt;IdentityUser&gt;&gt;();
  </code></pre>
  
  <p>But now there's another default instance StructureMap couldn't work out - the dbcontext. Here's the next error message I'm getting:</p>
  
  <pre><code>ExceptionMessage=StructureMap Exception Code:  202
  No Default Instance defined for PluginFamily System.Data.Entity.DbContext, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
  </code></pre>
  
  <p>Now I'm really lost...</p>