protected override void ConfigureApplicationContainer(StructureMap.IContainer existingContainer)
 {
     base.ConfigureApplicationContainer(existingContainer);
     existingContainer.Configure(x => x.AddRegistry<RavenDbBootstrapper>());
     existingContainer.Configure(x => x.For<HandlerModule<RobotCreatedEvent>>().Use<RobotCreatedEventHandler>());
     HandlerCentral.Container = existingContainer;
 }
 protected override void ConfigureApplicationContainer(StructureMap.IContainer existingContainer)
 {
     base.ConfigureApplicationContainer(existingContainer);
     existingContainer.Configure(x => x.For<IDocumentStore>().Singleton().Use(CurrentDocumentStore()));
     existingContainer.Configure(x => x.For<IDocumentSession>().HybridHttpOrThreadLocalScoped().Use(y => y.GetInstance<IDocumentStore>().OpenSession()));
     existingContainer.Configure(x => x.For<HandlerModule<UserCreatedEvent>>().Use<UserCreatedEventHandler>());
     HandlerCentral.Container = existingContainer;
 }
 protected override void ConfigureApplicationContainer(StructureMap.IContainer existingContainer)
 {
     base.ConfigureApplicationContainer(existingContainer);
     existingContainer.Configure(x => x.SelectConstructor(() => new FakeNancyModule()));
     existingContainer.Configure(x => x.For<IDocumentStore>().Singleton().Use(GetEmbededInMemoryStore));
     existingContainer.Configure(x => x.For<IDocumentSession>().HybridHttpOrThreadLocalScoped().Use(y => y.GetInstance<IDocumentStore>().OpenSession()));
     existingContainer.Configure(x => x.For<HandlerModule<RobotCreatedEvent>>().Use<RobotCreatedEventHandler>());
     HandlerCentral.Container = existingContainer;
 }
 protected override void ConfigureApplicationContainer(StructureMap.IContainer existingContainer)
 {
     existingContainer.Configure(c => 
         c.Scan(s => {
             s.AssemblyContainingType<IConvertStrings>();
             s.IncludeNamespaceContainingType<Md5Encoder>();
             s.AddAllTypesOf<IConvertStrings>();
             s.RegisterConcreteTypesAgainstTheFirstInterface();
             s.WithDefaultConventions().OnAddedPluginTypes(t => t.Singleton());
     }));
     existingContainer.Configure(a => a.For<IRazorConfiguration>().Singleton().Use<RazorConfiguration>());
     existingContainer.Configure(c => c.For<IConverterRepository>().Singleton().Use<ConverterRepository>());
     ServiceLocator.SetLocatorProvider(() => new StructureMapServiceLocator(existingContainer));
     base.ConfigureApplicationContainer(existingContainer);
 }
Beispiel #5
0
        public void RegisterServices(StructureMap.IContainer container)
        {
            // todo: add custom services.

            container.Configure(cfg =>
            {
                cfg.For<IArticlesService>().Use<EfArticlesService>();
            });
        }