コード例 #1
0
        protected static IRepository GetRepository()
        {
            var openSession          = MSpecAssemblyContext.NhibernateFluent <CallSessionContext>().BuildSessionFactory().OpenSession();
            var nhibernateRepository = new NhibernateRepository(/*Pleasure.MockStrictAsObject<INhibernateSessionFactory>(mock => mock.Setup(r => r.GetCurrent()).Returns(openSession))*/);

            nhibernateRepository.SetProvider(new Lazy <ISession>(() => openSession));
            return(nhibernateRepository);
        }
コード例 #2
0
        protected static IRepository GetRepository()
        {
            var openSession = MSpecAssemblyContext.NhibernateFluent().BuildSessionFactory().OpenSession();

            return(new NhibernateRepository(openSession));
        }