Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/linq/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C#在扩展方法中指定orderby_C#_Linq - Fatal编程技术网

C#在扩展方法中指定orderby

C#在扩展方法中指定orderby,c#,linq,C#,Linq,如何在扩展方法中指定降序 var qry=from p in context.Persons orderby p.salary descending select p; var qry=context.Persons.OrderBy(c=>c.salary); 扩展方法 var qry=from p in context.Persons orderby p.salary descending select

如何在扩展方法中指定降序

var qry=from p in context.Persons 
                   orderby p.salary descending select p;
var qry=context.Persons.OrderBy(c=>c.salary);
扩展方法

var qry=from p in context.Persons 
                   orderby p.salary descending select p;
var qry=context.Persons.OrderBy(c=>c.salary);
使用

使用

使用:

使用: