Exemplo n.º 1
0
        public void Contains8()
        {
            var arr = new[] { GrandChild.ElementAt(0), GrandChild.ElementAt(1) };

            ForEachProvider(db => AreEqual(
                                from p in Parent
                                join ch in Child on p.ParentID equals ch.ParentID
                                join gc in GrandChild on ch.ChildID equals gc.ChildID
                                where arr.Contains(gc)
                                select p,
                                from p in db.Parent
                                join ch in db.Child on p.ParentID equals ch.ParentID
                                join gc in db.GrandChild on ch.ChildID equals gc.ChildID
                                where arr.Contains(gc)
                                select p));
        }
Exemplo n.º 2
0
        public void NotContains8([DataSources] string context)
        {
            var arr = new[] { GrandChild.ElementAt(0), GrandChild.ElementAt(1) };

            using (var db = GetDataContext(context))
                AreEqual(
                    from p in Parent
                    join ch in Child on p.ParentID equals ch.ParentID
                    join gc in GrandChild on ch.ChildID equals gc.ChildID
                    where !arr.Contains(gc)
                    select p
                    ,
                    from p in db.Parent
                    join ch in db.Child on p.ParentID equals ch.ParentID
                    join gc in db.GrandChild on ch.ChildID equals gc.ChildID
                    where !arr.Contains(gc)
                    select p);
        }
Exemplo n.º 3
0
        public void Contains801()
        {
            var arr = new[] { GrandChild.ElementAt(0), GrandChild.ElementAt(1) };

            ForEachProvider(db => AreEqual(
                                from p in Parent
                                join ch in Child on p.ParentID equals ch.ParentID
                                join gc in GrandChild on ch.ChildID equals gc.ChildID
                                select new GrandChild {
                ParentID = 2, ChildID = ch.ChildID, GrandChildID = gc.GrandChildID
            } into gc
                                where arr.Contains(gc)
                                select gc,
                                from p in db.Parent
                                join ch in db.Child on p.ParentID equals ch.ParentID
                                join gc in db.GrandChild on ch.ChildID equals gc.ChildID
                                select new GrandChild {
                ParentID = 2, ChildID = ch.ChildID, GrandChildID = gc.GrandChildID
            } into gc
                                where arr.Contains(gc)
                                select gc));
        }
Exemplo n.º 4
0
        public void Contains803(string context)
        {
            var arr = new[] { GrandChild.ElementAt(0), GrandChild.ElementAt(1) };

            using (var db = GetDataContext(context))
                AreEqual(
                    from p in Parent
                    join ch in Child on p.ParentID equals ch.ParentID
                    join gc in GrandChild on ch.ChildID equals gc.ChildID
                    where arr.Contains(new GrandChild {
                    ParentID = 1, ChildID = ch.ChildID, GrandChildID = gc.GrandChildID
                })
                    select p
                    ,
                    from p in db.Parent
                    join ch in db.Child on p.ParentID equals ch.ParentID
                    join gc in db.GrandChild on ch.ChildID equals gc.ChildID
                    where arr.Contains(new GrandChild {
                    ParentID = 1, ChildID = ch.ChildID, GrandChildID = gc.GrandChildID
                })
                    select p);
        }
Exemplo n.º 5
0
        public void Contains801([DataSources] string context)
        {
            var arr = new[] { GrandChild.ElementAt(0), GrandChild.ElementAt(1) };

            using (var db = GetDataContext(context))
                AreEqual(
                    from p in Parent
                    join ch in Child on p.ParentID equals ch.ParentID
                    join gc in GrandChild on ch.ChildID equals gc.ChildID
                    select new GrandChild {
                    ParentID = 2, ChildID = ch.ChildID, GrandChildID = gc.GrandChildID
                } into gc
                    where arr.Contains(gc)
                    select gc
                    ,
                    from p in db.Parent
                    join ch in db.Child on p.ParentID equals ch.ParentID
                    join gc in db.GrandChild on ch.ChildID equals gc.ChildID
                    select new GrandChild {
                    ParentID = 2, ChildID = ch.ChildID, GrandChildID = gc.GrandChildID
                } into gc
                    where arr.Contains(gc)
                    select gc);
        }