惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Attack and Defense Labs
Attack and Defense Labs
T
Threatpost
C
Cybersecurity and Infrastructure Security Agency CISA
H
Hackread – Cybersecurity News, Data Breaches, AI and More
I
Intezer
C
Cyber Attacks, Cyber Crime and Cyber Security
The Register - Security
The Register - Security
量子位
Security Latest
Security Latest
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
大猫的无限游戏
大猫的无限游戏
小众软件
小众软件
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
C
CXSECURITY Database RSS Feed - CXSecurity.com
MyScale Blog
MyScale Blog
J
Java Code Geeks
Apple Machine Learning Research
Apple Machine Learning Research
Google DeepMind News
Google DeepMind News
WordPress大学
WordPress大学
Spread Privacy
Spread Privacy
Jina AI
Jina AI
博客园 - 【当耐特】
P
Palo Alto Networks Blog
Last Week in AI
Last Week in AI
SecWiki News
SecWiki News
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
G
GRAHAM CLULEY
宝玉的分享
宝玉的分享
Hacker News - Newest:
Hacker News - Newest: "LLM"
T
The Blog of Author Tim Ferriss
V
Vulnerabilities – Threatpost
有赞技术团队
有赞技术团队
T
Tor Project blog
H
Hacker News: Front Page
A
Arctic Wolf
NISL@THU
NISL@THU
A
About on SuperTechFans
云风的 BLOG
云风的 BLOG
Engineering at Meta
Engineering at Meta
V
V2EX
N
News and Events Feed by Topic
Webroot Blog
Webroot Blog
Know Your Adversary
Know Your Adversary
P
Privacy International News Feed
I
InfoQ
D
Docker
L
LINUX DO - 最新话题
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
U
Unit 42

博客园 - 南阳·源

ThinkPHP运算符与PHP运算符对照表 ThinkPHP常用配置路径 Asp.Net MVC3(三)-MvcApp实现全局异常捕获 Json数据字符串 反序列化对象时出现错误。遇到意外字符 ICSharpCode.SharpZipLib.dll压缩的zip包,7zip解压时出错 日期转换为中文日期 向大家推荐一款UI对话框框架artDialog Asp.Net MVC3(二)-过滤器定义 Asp.Net MVC3(一)-多Area时,路由设置问题 Json数据序列化对象,及对象序列化为Json格式 序列化/反序化 C# Enum转换 WCF访问安全 跨域访问WCF问题 [转] 检索 COM 类工厂中 CLSID 为 {000209FF-0000-0000-C000-000000000046} 的组件时失败 Split [转]RegistryKey 操作注册表 js控制ctrl+p sql:过滤字段中是否包含数字
List<T> OrderBy问题
南阳·源 · 2012-01-31 · via 博客园 - 南阳·源

List<List1Dto> listResult = new List<List1Dto>();            

listResult.Add(new List1Dto { UserName = "user1", UserPwd = "user1", UserTitle = "user1", OrderNumber = "1" });            

listResult.Add(new List1Dto { UserName = "user2", UserPwd = "user2", UserTitle = "user2", OrderNumber = "2" });            

listResult.Add(new List1Dto { UserName = "user10", UserPwd = "user10", UserTitle = "user10", OrderNumber = "10" });            

listResult.Add(new List1Dto { UserName = "user20", UserPwd = "user20", UserTitle = "user20", OrderNumber = "20" });

List<List1Dto> list1 = listResult.OrderBy(ao => ao.OrderNumber).ToList();            

string tmp = "";            

foreach (List1Dto item in list1)            

{                

  tmp += item.UserName + "\r\n";           

}

结果:

user1

user10

user2

user20

修改:

List<List1Dto> list1 = listResult.OrderBy(ao => Convert.ToInt32( string.IsNullOrEmpty(ao.OrderNumber) ? "0" : ao.OrderNumber)).ToList();