Example #1
0
        public void CanExecuteQueryBatch()
        {
            FutureQueryOf<Parent> futureQueryOfParents = new FutureQueryOf<Parent>(DetachedCriteria.For<Parent>());
            FutureQueryOf<Child> futureQueryOfChildren = new FutureQueryOf<Child>(DetachedCriteria.For<Child>());
            Assert.AreEqual(0, futureQueryOfParents.Results.Count);

            //This also kills the database, because we use an in
            // memory one ,so we ensure that the code is not
            // executing a second query
            CurrentContext.DisposeUnitOfWork();

            Assert.AreEqual(0,  futureQueryOfChildren.Results.Count);
        }
Example #2
0
        public void CanExecuteQueryBatch() {
#pragma warning disable 0618
            var futureQueryOfParents = new FutureQueryOf<Parent>(DetachedCriteria.For<Parent>());
            var futureQueryOfChildren = new FutureQueryOf<Child>(DetachedCriteria.For<Child>());

            Assert.IsTrue(futureQueryOfParents.Results.Count > 0);
            Assert.IsTrue(futureQueryOfChildren.Results.Count > 0);
#pragma warning restore 0618

            //! NHibernate 3.x 의 Future 기능을 사용하세요!!!
            //
            var futureOfParents = Repository<Parent>.Future(QueryOver.Of<Parent>());
            var futureOfChildren = Repository<Child>.Future(QueryOver.Of<Child>());

            futureOfParents.Count().Should().Be.GreaterThan(0);
            futureOfChildren.Count().Should().Be.GreaterThan(0);
        }