I'm sure this will be a relatively simple one.
(我相信这将是一个相对简单的。)
I have a LINQ query that I want to order by the most recently created date.
(我有一个LINQ查询,我想按最近创??建的日期排序。)
See:
(看到:)
var itemList = from t in ctn.Items
where !t.Items && t.DeliverySelection
orderby t.Delivery.SubmissionDate descending
select t;
I have also tried:
(我也尝试过:)
var itemList = (from t in ctn.Items
where !t.Items && t.DeliverySelection
select t).OrderByDescending();
but this gives an error :
(但这会给出一个错误:)
No overload for method 'OrderByDescending' takes 0 arguments
(方法'OrderByDescending'的重载不带0参数)
From what I've read, I'm fairly sure the first way I've done it should work.
(从我所读到的,我很确定我做的第一种方式应该有效。)
I've tried changing descending to ascending just to see if it does anything but it stays the same. (我已经尝试将降序改为升序只是为了看它是否做了什么,但它保持不变。)
I'd be grateful if someone could take a look at the query and see if I'm doing anything wrong.
(如果有人能够查看查询并查看我是否做错了什么,我将不胜感激。)
Thanks :) (谢谢 :))
ask by 109221793 translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…