示例#1
0
        private static void RegisterServices(IStashboxContainer container)
        {
            container.RegisterType<LinkManager>();

            container.RegisterType<HomeController>();

            container.RegisterType<IAuthorizationManager, AuthorizationManager>();

            container.PrepareType<IProfileConfiguration, ProfileConfiguration>()
                     .WithFactory(() => new ProfileConfiguration())
                     .WithLifetime(new SingletonLifetime())
                     .Register();

            //var userManager = new UserManager<IAuthorizationManager, IProfileConfiguration>();

            //container.BuildUp<UserManager<IAuthorizationManager, IProfileConfiguration>>(userManager);

            container.RegisterType<IUserManager, UserManager<IAuthorizationManager, IProfileConfiguration>>();

            container.PrepareType<IControllerFactory, StashboxControllerFactory>()
                     .WithFactory(() => new StashboxControllerFactory(container))
                     .WithLifetime(new SingletonLifetime())
                     .Register();
        }
示例#2
0
 public void Compose(IStashboxContainer container)
 {
     container.RegisterType <ITest1, Test11>();
     container.RegisterType <ITest2, Test12>();
 }