Inheritance: NHibernate.Proxy.AbstractProxyFactory
        public override void Load()
        {
            var p = new ProxyFactory(); //Ugly quickfix just to trigger reference

            Kernel
                .Bind<Configuration>()
                .ToMethod(ctx => new Configuration().Configure())
                .InSingletonScope();

            Kernel
                .Bind<ISessionFactory>()
                .ToMethod(ctx => AppEnvironment.IoC.Resolve<Configuration>().BuildSessionFactory())
                .InSingletonScope();

            Kernel.Bind<ISession>()
                .ToMethod(ctx =>
                {
                    var session = AppEnvironment.IoC.Resolve<ISessionFactory>().OpenSession();
                    session.FlushMode = FlushMode.Never;

                    return session;
                });

            Kernel
                .Bind<IUnitOfWork>()
                .To<NHibUnitOfWork>();

            Kernel
                .Bind<IQueryEngine>()
                .To<NHibQueryEngine>();
        }
Esempio n. 2
0
        private static void ForceLoadingAssembliesForMsTestRunner()
        {
            //Just to make sure the Castle.Core assembly is loaded for Microsoft Unit Test Runner
            var castleConfig = typeof(Castle.Core.Configuration.IConfiguration);

            //Just to make sure the NHibernate.ByteCode.Castle assembly and Castle.Core assembly is loaded for Microsft Unit Test Runner
            var proxyFactory = new ProxyFactory();

            //Just to make sure the ByteCodeCastle assembly is loaded for Microsft Unit Test Runner
            var sqLiteParameter = new SQLiteParameter();
        }
Esempio n. 3
0
 private static void MakeReferenceSoMSBuildLoadsDLL()
 {
     //This is never called, but it forces the compiler to include the ByteCode DLL
     var x = new ProxyFactory();
 }