obase社区Obase开发者QQ群:962698871
obase

欢迎查阅
OBASE帮助文档

类似Linq的排序,我们也可以对ObjectSet使用OrderBy和OrderByDescending分别来正序排序和倒序排序。

//排序
var orderResult = context.JavaBeans.OrderByDescending(p => p.DecimalNumber).ToList();

Console.WriteLine("RunResult:");
foreach (var item in orderResult) Console.WriteLine($"{item}");

运行结果是

RunResult:
JavaBeanLikeModel:{IntNumber-20,DecimalNumber-8769956796,DateTime-"2020-10-22 12:15:23",String-"20号字符串",Bool-"True"}
JavaBeanLikeModel:{IntNumber-19,DecimalNumber-2791563950,DateTime-"2020-10-22 12:15:23",String-"19号字符串",Bool-"False"}
JavaBeanLikeModel:{IntNumber-18,DecimalNumber-888582403,DateTime-"2020-10-22 12:15:23",String-"18号字符串",Bool-"True"}
JavaBeanLikeModel:{IntNumber-17,DecimalNumber-282844564,DateTime-"2020-10-22 12:15:23",String-"17号字符串",Bool-"False"}
JavaBeanLikeModel:{IntNumber-16,DecimalNumber-90032221,DateTime-"2020-10-22 12:15:23",String-"16号字符串",Bool-"True"}
JavaBeanLikeModel:{IntNumber-15,DecimalNumber-28658146,DateTime-"2020-10-22 12:15:23",String-"15号字符串",Bool-"False"}
JavaBeanLikeModel:{IntNumber-14,DecimalNumber-9122171,DateTime-"2020-10-22 12:15:23",String-"14号字符串",Bool-"True"}
JavaBeanLikeModel:{IntNumber-13,DecimalNumber-2903677,DateTime-"2020-10-22 12:15:23",String-"13号字符串",Bool-"False"}
JavaBeanLikeModel:{IntNumber-12,DecimalNumber-924269,DateTime-"2020-10-22 12:15:23",String-"12号字符串",Bool-"True"}
JavaBeanLikeModel:{IntNumber-11,DecimalNumber-294204,DateTime-"2020-10-22 12:15:23",String-"11号字符串",Bool-"False"}
JavaBeanLikeModel:{IntNumber-10,DecimalNumber-93648,DateTime-"2020-10-22 12:15:23",String-"10号字符串",Bool-"True"}
JavaBeanLikeModel:{IntNumber-9,DecimalNumber-29809,DateTime-"2020-10-22 12:15:23",String-"9号字符串",Bool-"False"]}
JavaBeanLikeModel:{IntNumber-8,DecimalNumber-9489,DateTime-"2020-10-22 12:15:23",String-"8号字符串",Bool-"True"}
JavaBeanLikeModel:{IntNumber-7,DecimalNumber-3020,DateTime-"2020-10-22 12:15:23",String-"7号字符串",Bool-"False"}
JavaBeanLikeModel:{IntNumber-6,DecimalNumber-961,DateTime-"2020-10-22 12:15:23",String-"6号字符串",Bool-"True"}
JavaBeanLikeModel:{IntNumber-5,DecimalNumber-306,DateTime-"2020-10-22 12:15:23",String-"5号字符串",Bool-"False"}
JavaBeanLikeModel:{IntNumber-4,DecimalNumber-97,DateTime-"2020-10-22 12:15:23",String-"4号字符串",Bool-"True"}
JavaBeanLikeModel:{IntNumber-3,DecimalNumber-31,DateTime-"2020-10-22 12:15:23",String-"3号字符串",Bool-"False"}
JavaBeanLikeModel:{IntNumber-2,DecimalNumber-10,DateTime-"2020-10-22 12:15:23",String-"2号字符串",Bool-"True"}
JavaBeanLikeModel:{IntNumber-1,DecimalNumber-3,DateTime-"2020-10-22 12:15:23",String-"1号字符串",Bool-"False"}

没有找到您需要的文档?

您还可以通过人工服务在线咨询,服务时间为每天上午9点至下午6点。

If you can't find required answer, get in touch with us online. We provide service from 9:00 to 18:00.

让编程成为一件快乐的事
现在开始