Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>As others mentioned you'd want to look at <a href="http://commonservicelocator.codeplex.com/" rel="nofollow">Common Service Locator</a> (CSL) that is a simple service resolution facade around any container (any of your choice).</p> <p>MVC3 internally heavily uses the new <a href="http://bradwilson.typepad.com/blog/2010/10/service-location-pt5-idependencyresolver.html" rel="nofollow">IDependencyResolver</a> interface which is somewhat like CSL but in ASP.NET MVC context. The good thing is that if you are already using CSL then you can set it <strong>as</strong> Dependency Resolver for MVC.</p> <p>This topic is equally essential for any container and not specific to StructureMap.</p> <p>So what is going on there:</p> <ul> <li>You provide all necessary container registrations (preferrably through Registry DSL in case of StructureMap);</li> <li>You get the <a href="http://commonservicelocator.codeplex.com/wikipage?title=StructureMap%20Adapter" rel="nofollow">StructureMap adapter</a> for Common Service Locator;</li> <li>You (optionally - if you need CSL along with DependencyResolver) register your StructureMap adapter as current Service Locator: <code>ServiceLocator.SetLocatorProvider(() =&gt; yourStructureMapAdapter)</code></li> <li>You register your CSL (backed by StructureMap) as MVC DependencyResolver: <code>DependencyResolver.SetResolver(yourStructureMapAdapter)</code></li> <li>MVC3 automatically wires everything up through <a href="http://bradwilson.typepad.com/blog/2010/10/service-location-pt5-idependencyresolver.html" rel="nofollow">IDependencyResolver</a> interface internally (using all StrucutreMap DI auto-wiring capabilities).</li> </ul> <p>Along with MVC3 baked-in IoC capabilities, use the power of IoC tool at your disposal (e.g. use Assemblies scanning available in StructureMap) to max extent.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload