我想做以下但我认为这不会起作用:
.OrderByDescending(s => Score(s)), ... private double Score(Story s) { DateTime now = DateTime.Now; TimeSpan elapsed = now.Subtract(s.PostedOn); double daysAgo = elapsed.TotalDays; return s.Votes.Count + s.Comments.Count - daysAgo; }
一个.这有用吗?湾 如果没有,我是否需要查询故事,然后按分数对它们进行排序?