Beispiel #1
0
        public List <User> GetUserByAge()
        {
            ICriteria <User> conditionPerson =
                CriteriaFactory.Create <User>().Where(u => u.Age < this.Age).OrderBy <string>(u => u.Name).Skip(8).Take(8);

            return(DataPortal.Query(conditionPerson));
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            User p = new User();

            p.Age = 3;
            CriteriaProvider provider = new CriteriaProvider();
            //ICriteria<Person> condition =
            //    new Criteria<Person>().Where(u => u.Name.Contains("a") && u.Age > p.Age || u.Age < 7).OrderBy<string>(u => u.Name).Distinct<string>(u => u.Name).Skip(2);
            //  provider.Execute(condition);
            ICriteria <User> conditionPerson =
                CriteriaFactory.Create <User>().Where(u => u.Age < 7).OrderBy <string>(u => u.Name).Skip(2).Take(10);

            provider.Execute(conditionPerson);
        }