//查询操作符
public static void LambdaDemoDelegatePlus()
{
var result=Process.GetProcesses().where(pro=>pro.WorkingSet64>20*1024*1024)
.OrderByDescending(pro>pro.WorkingSet64)
.select(pro=>{id=pro.Id,Name=pro.ProcessName,Memory=pro.WorkingSet64});
ObjectDumper.Write(result,1);
}
//查询表达式
public static void LambdaDemoDelegatePlus()
{
var result = from pro in Process.GetProcesses()
where pro.WorkingSet64 > 20 * 1024 * 1024
orderby pro.WorkingSet64 descending
select new
{
id = pro.Id,
Name = pro.ProcessName,
Memory = pro.WorkingSet64
};
//查询表达式
ObjectDumper.Write(result,1);
}
使用查询表达式能够享受到类似SQl的语法所带来的便利