示例#1
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);
        }
示例#2
0
 public Criteria()
 {
     provider             = new CriteriaProvider();
     expressionDictionary = new Dictionary <string, List <Expression> >();
 }