Expression<Func<int, bool>>与<Func<int, bool>
Expression<Func<int, bool>>是表达式,
<Func<int, bool>是委派(delegate)
Expression编译后就会变成delegate,才能运行。
比如 Expression<Func<int, bool>> ex = x=>x < 100;
x=>x < 100 ---> x是输入参数 int类型,x<100是函数体,返回bool类型
Func<int, bool> func = ex.Compile();
然后你就可以调用func:
func(5) //-返回 true
func(200) //- 返回 false
而表达式是不能直接调用的。
var articles = context.Employees.OrderBy(p=>p.EmployeeName).Skip(startRecord).Take(pageSize);