Example #1
0
        public void WithEntities()
        {
            System.Collections.IEnumerable persons = session.CreateCriteria(typeof(Person)).List <Person>();

            Assert.AreEqual(2,
                            session.CreateCriteria(typeof(Mail))
                            .Add(XmlIn.Create("To", persons, 1))
                            .List <Mail>()
                            .Count);
        }
Example #2
0
        public void WithValues()
        {
            int[] persons = new int[] { 0, 1, 2 };

            Assert.AreEqual(1,
                            session.CreateCriteria(typeof(Mail))
                            .Add(XmlIn.Create("From.Id", persons, 1))
                            .List <Mail>()
                            .Count);
        }
Example #3
0
        public void TwoXmlIn()
        {
            System.Collections.IEnumerable persons = session.CreateCriteria(typeof(Person)).List <Person>();

            Assert.AreEqual(2,
                            session.CreateCriteria(typeof(Mail))
                            .Add(Restrictions.And(XmlIn.Create("From", persons, 1),
                                                  XmlIn.Create("To", persons, 1)))
                            .List <Mail>().Count);
        }
Example #4
0
        public void WithEntitiesAndNoResults()
        {
            IList <Person> justBob = new List <Person>();

            justBob.Add(bob);

            Assert.AreEqual(0,
                            session.CreateCriteria(typeof(Mail))
                            .Add(XmlIn.Create("To", justBob))
                            .List <Mail>()
                            .Count);
        }