コード例 #1
0
        public void Install(Castle.Windsor.IWindsorContainer container, Castle.MicroKernel.SubSystems.Configuration.IConfigurationStore store)
        {
            container.AddFacility<AutoTxFacility>();
            container.Register(Component.For<INHibernateInstaller>().ImplementedBy<NHibernateInstaller>());//.LifeStyle.Singleton);

            var ni = container.Resolve<INHibernateInstaller>();
            var t = container.ResolveAll<IInterceptor>();

            //container.AddFacility<NHibernateFacility>();
            container.AddFacility<NHibernateFacility>(f => f.DefaultLifeStyle = DefaultSessionLifeStyleOption.SessionPerWebRequest);

            container.Install(FromAssembly.Containing<PersonRepository>());
        }