Exemplo n.º 1
0
        /// <summary>
        /// Returns new Castle Windsor container configured for WebAPI.
        /// </summary>
        public static IWindsorContainer CreateWindsorContainer(IConfiguration configuration)
        {
            IWindsorContainer container = new WindsorContainer();

            container.ConfigureForWebAPI(configuration);
            container.Register(Component.For <ErrorMonitoringFilter>().LifestylePerAspNetCoreRequest());
            container.Register(Component.For <IApplicationAuthenticationService>().ImplementedBy <ApplicationAuthenticationService>().LifestylePerAspNetCoreRequest());
            container.Register(Component.For <IUserContextInfoBuilder>().ImplementedBy <Infrastructure.Security.UserContextInfoBuilder>().LifestylePerAspNetCoreRequest());
            return(container);
        }