Skip to content

Instantly share code, notes, and snippets.

@komainu85
Created May 21, 2015 15:07
Show Gist options
  • Save komainu85/e0fbffe109c67eb532dc to your computer and use it in GitHub Desktop.
Save komainu85/e0fbffe109c67eb532dc to your computer and use it in GitHub Desktop.
Sitecore Register IoC StructureMap
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<pipelines>
<initialize>
<processor patch:after="processor[@type='Sitecore.Mvc.Pipelines.Loader.InitializeRoutes, Sitecore.Mvc']" type="MikeRobbins.EntityServiceDemo.Pipelines.Initialize.RegisterIoC, MikeRobbins.EntityServiceDemo"/>
</initialize>
</pipelines>
</sitecore>
</configuration>
public class RegisterIoC
{
public void Process(PipelineArgs args)
{
var config = GlobalConfiguration.Configuration;
var container = new Container(new Registry());
config.DependencyResolver = new StructureMapDependencyResolver(container);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment