[英]Wrong order when using System.Linq.Dynamic with MongoDB collection
I use System.Linq.Dynamic
to order a MongoDB collection. 我使用System.Linq.Dynamic
来订购MongoDB集合。
mongoCollection.AsQueryable().OrderBy("Name ASC");
But the lowercase names gets ordered after the capital cased names, so the items are returned something like this. 但是小写字母的名称在大写字母的名称之后进行排序,因此返回的项目如下所示。
I rather expected this: 我宁愿这样:
Is there a way to get the correct order? 有没有办法获得正确的订单?
你有没有尝试过
mongoCollection.AsQueryable().ToList().OrderBy(c=>c.Name.ToLower());
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.