我正在通过利用LINQPad查询现有的OData饲料,了解OData。 利用Netflix馈赠,我试图获得一份获赔最多的行动者名单,但我正在经历奇怪的例外。 我的第一次尝试是:
People.OrderByDescending(p => p.Awards.Count).Take(10)
但是,这给我一个<代码>5Dataservice QueryException,但内有例外:
没有财产类型 System.Collections.Generic.ICollection'1[[Netflix.Catalog.v2.Entities]。 标题Award, Netflix.Catalog.v2, FCCC/SBI/2007/8, 第7页。
我试图用<代码>.Count()推广方法而不是<代码>来改变情况。 不动产:
People.OrderByDescending(p => p.Awards.Count()).Take(10)
但是,这只是玩:,我是英瓦利德卡斯特约会:
Unable to cast object of type System.Linq.Expressions.PropertyExpression to type System.Data.Services.Client.ResourceExpression .
at System.Data.Services.Client.ResourceBinder.AnalyzeCountMethod(MethodCallExpression mce)
at System.Data.Services.Client.ResourceBinder.VisitMethodCall(MethodCallExpression mce)
at System.Data.Services.Client.ALinqExpressionVisitor.Visit(Expression exp)
at System.Data.Services.Client.DataServiceALinqExpressionVisitor.Visit(Expression exp)
at System.Data.Services.Client.ALinqExpressionVisitor.VisitLambda(LambdaExpression lambda)
at System.Data.Services.Client.ALinqExpressionVisitor.Visit(Expression exp)
at System.Data.Services.Client.DataServiceALinqExpressionVisitor.Visit(Expression exp)
at System.Data.Services.Client.ALinqExpressionVisitor.VisitUnary(UnaryExpression u)
at System.Data.Services.Client.ALinqExpressionVisitor.Visit(Expression exp)
at System.Data.Services.Client.DataServiceALinqExpressionVisitor.Visit(Expression exp)
at System.Data.Services.Client.ALinqExpressionVisitor.VisitExpressionList(ReadOnlyCollection1 original)
1 original)
at System.Data.Services.Client.ALinqExpressionVisitor.VisitMethodCall(MethodCallExpression m)
at System.Data.Services.Client.ResourceBinder.VisitMethodCall(MethodCallExpression mce)
at System.Data.Services.Client.ALinqExpressionVisitor.Visit(Expression exp)
at System.Data.Services.Client.DataServiceALinqExpressionVisitor.Visit(Expression exp)
at System.Data.Services.Client.ALinqExpressionVisitor.VisitExpressionList(ReadOnlyCollection
at System.Data.Services.Client.ALinqExpressionVisitor.VisitMethodCall(MethodCallExpression m)
at System.Data.Services.Client.ResourceBinder.VisitMethodCall(MethodCallExpression mce)
at System.Data.Services.Client.ALinqExpressionVisitor.Visit(Expression exp)
at System.Data.Services.Client.DataServiceALinqExpressionVisitor.Visit(Expression exp)
at System.Data.Services.Client.ResourceBinder.Bind(Expression e)
at System.Data.Services.Client.DataServiceQueryProvider.Translate(Expression e)
at System.Data.Services.Client.DataServiceQuery1.Execute()
1.GetEnumerator()
at System.Data.Services.Client.DataServiceQuery
at System.Data.Services.Client.DataServiceQuery`1.System.Collections.IEnumerable.GetEnumerator()
I tried to follow the suggestions at this question but all I got is one of the above two errors.
任何关于如何开展这一简单行动的想法?