public void basic() { IQueryable<Person> users = Data.GetPersons(); Filter filter = new Filter { ConstraintList = new List<Pair> { new Pair { "Name", new FilterConstraint { Equals = "Tazo" } }, new Pair { "Name", new FilterConstraint { ContainsString = "2" } } } }; List<Person> resultList = users.Filter(filter).ToList(); ShowData(resultList); }
public void TestLess() { var filter = new Filter { ConstraintList = new List<Pair> { new Pair { "BirthDate", new FilterConstraint { LessThan = DateTime.Parse("10/10/2001 12:00:00 AM") //DateTime.Now } } }, Or = true }; var personSet = Data.GetPersons().Filter(filter).ToList(); ShowData(personSet); }
public void TestStringAndInt() { var filter = new Filter { ConstraintList = new List<Pair> { new Pair { "Name", new FilterConstraint { StartsWith = "tazo", EndsWith = "2" } }, new Pair { "Age", new FilterConstraint { Equals = (short)18 } } }, Or = true }; var personSet = Data.GetPersons().Filter(filter).ToList(); ShowData(personSet); }