Exemplo n.º 1
0
        private static void InstallWindsorIntegration(IServiceCollection services, IWindsorContainer container)
        {
            container.Kernel.Resolver.AddSubResolver(new ArrayResolver(container.Kernel));

            var loggerDependencyResolver = new LoggerDependencyResolver();

            container.Register(Component.For <IAcceptServiceProvider>().Instance(loggerDependencyResolver));
            container.Kernel.Resolver.AddSubResolver(loggerDependencyResolver);

            var frameworkDependencyResolver = new FrameworkDependencyResolver(services);

            container.Register(Component.For <IAcceptServiceProvider>().Instance(frameworkDependencyResolver));
            container.Kernel.Resolver.AddSubResolver(frameworkDependencyResolver);
        }
Exemplo n.º 2
0
        protected virtual void RegisterCastle()
        {
            var logger    = new LoggerDependencyResolver();
            var framework = new FrameworkDependencyResolver(services);

            Kernel.Register(
                Component.For <IServiceProviderVisitor>()
                .Instance(logger)
                .LifestyleSingleton(),
                Component.For <IServiceProviderVisitor>()
                .Instance(framework)
                .LifestyleSingleton(),
                Component.For <IServiceProvider>()
                .Forward <IServiceProviderFactory>()
                .Forward <IServiceProviderVisitor>()
                .ImplementedBy <ServiceProviderFactory>()
                .LifestyleSingleton()
                );
            Kernel.Resolver.AddSubResolver(logger);
            Kernel.Resolver.AddSubResolver(framework);
        }
Exemplo n.º 3
0
 protected override void Load(ContainerBuilder builder)
 {
     FrameworkDependencyResolver.RegisterServices(builder);
 }
 public void SetUp()
 {
     testContext = TestContextFactory.Get();
     frameworkDependencyResolver = new FrameworkDependencyResolver(testContext.ServiceCollection);
     frameworkDependencyResolver.AcceptServiceProvider(testContext.ServiceProvider);
 }