Skip to content

Instantly share code, notes, and snippets.

@KevM
Created January 29, 2015 20:54
Show Gist options
  • Select an option

  • Save KevM/6538b6fb243bf8172e1d to your computer and use it in GitHub Desktop.

Select an option

Save KevM/6538b6fb243bf8172e1d to your computer and use it in GitHub Desktop.
Make sure all your Bottle StructureMap registries are imported
public class WebRegistry : Registry
{
public WebRegistry()
{
//Your application's normal registries
IncludeRegistry<BootstrapRegistry>();
IncludeRegistry<SettingsProviderRegistry>();
//typical scanner type stuff
Scan(x =>
{
x.TheCallingAssembly();
x.WithDefaultConventions();
});
//scan all bottle assemblies looking for registries
Scan(scanner =>
{
PackageRegistry.PackageAssemblies.Each(scanner.Assembly);
scanner.LookForRegistries();
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment