Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我使用 Entity Frameword 并希望列出按 2 个字段排序的对象。我的表达如下:
TbCusromers.OrderBy(x->x.Family, x.Name);
如何按家庭和姓名对列表顺序进行排序?
TbCusromers.OrderBy(x=>x.Family).ThenBy(x=>x.Name);
虽然我赞成上述答案,但您可能还想考虑这一点。
TbCusromers.OrderBy( x=> x.Family + x.Name )
这将允许您按两个字段的连接版本进行排序。