Esempio n. 1
0
        public void Options_FilterNotAppliedToChildEntities()
        {
            using (var context = new TestContext())
            {
                if (DynamicFilterQueryVisitorCSpace.DoesNotSupportElementMethod(context))
                {
                    return;     //  This test requires full CSpace support (Oracle 11 does not support this)
                }
                var list = context.EntityASet.Include(a => a.Children).ToList();

                Assert.IsTrue((list.Count == 1) && (list.Single().Children.Count == 2));
            }
        }
Esempio n. 2
0
        public void Options_FilterNotAppliedRecursively2()
        {
            using (var context = new TestContext())
            {
                if (DynamicFilterQueryVisitorCSpace.DoesNotSupportElementMethod(context))
                {
                    return;     //  This test requires full CSpace support (Oracle 11 does not support this)
                }
                var list = context.EntityCSet.Include(x => x.Children.Select(y => y.Children)).ToList();

                Assert.IsTrue(list.All(x => (x.ID == 1)) && (list.Single().Children.Count == 2));

                Assert.IsTrue(list.Single().Children.First(x => x.ID == 1).Children.Count == 2);
                Assert.IsTrue(list.Single().Children.First(x => x.ID == 2).Children.Count == 2);
            }
        }
Esempio n. 3
0
        public void Options_FilterNotAppliedRecursively3()
        {
            //  This entity has 2 sets of children that both implement the ISoftDelete interface
            //  as do their child.  Tests to make sure that BOTH of the properties inside EntityD
            //  are filtered and that neither of their child collections are filtered.
            using (var context = new TestContext())
            {
                if (DynamicFilterQueryVisitorCSpace.DoesNotSupportElementMethod(context))
                {
                    return;     //  This test requires full CSpace support (Oracle 11 does not support this)
                }
                var list = context.EntityDSet
                           .Include(x => x.Children1.Select(y => y.Children))
                           .Include(x => x.Children2.Select(y => y.Children))
                           .ToList();

                var d = list.Single();

                Assert.IsTrue(d.Children1.All(x => x.ID == 1));
                Assert.IsTrue(d.Children1.Single().Children.Count == 2);
                Assert.IsTrue(d.Children2.All(x => x.ID == 1));
                Assert.IsTrue(d.Children2.Single().Children.Count == 2);
            }
        }