Example #1
0
        public void SimpleIntersect()
        {
            EmployeeCollection collection = new EmployeeCollection();

            collection.es.Connection.Name = "ForeignKeyTest";

            EmployeeQuery eq1 = new EmployeeQuery("eq1");
            EmployeeQuery eq2 = new EmployeeQuery("eq2");

            // Only includes rows with both "n" and"a"
            eq1.Where(eq1.FirstName.Like("%n%"));
            eq1.Intersect(eq2);
            eq2.Where(eq2.FirstName.Like("%a%"));

            Assert.IsTrue(collection.Load(eq1));
            Assert.AreEqual(2, collection.Count);
        }