2
我在我的項目中使用Raven Db。我試着去訂購像文章OrderBy使用RavenDB-例外
list.OrderByDescending(x => x.Supporters.Sum(y=>y.Tokens));
,我得到這樣一個例外:
{"Unable to cast object of type 'System.Linq.Expressions.MethodCallExpressionN' to type 'System.Linq.Expressions.MemberExpression'."}
型號看起來如下:
public class Idea
{
(...)
public IList<IdeaSupporter> Supporters { get; set; }
}
public class IdeaSupporter
{
(...)
public int Tokens { get; set; }
}
什麼我錯了嗎? 感謝您的幫助。
如何列表中聲明? – 2011-12-19 14:56:37