public class Person { public string Name { get; set; } public int Age { get; set; } public int Salary { get; set; } } List<Person> Persons=new List<Person> () Type TType=typeof(Person); ParameterExpression pp = Expression.Parameter(TType, "p"); Expression temp = Expression.GreaterThan(Expression.Call(Expression.Property(pp, TType.GetProperty("Age")), ??????), Expression.Constant(20));var lambda = Expression.Lambda<Func<Person, bool>>(temp, pp);
我想动态构建出Persons.Where(p=>p.Age>20).ToList(); 表达式请问怎么写啊!请帮帮忙!一个新手的求救!
1 回答
- 1 回答
- 0 关注
- 309 浏览
添加回答
举报
0/150
提交
取消