Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6716157
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:41:58+00:00 2026-05-26T08:41:58+00:00

I am getting to know OData by querying existing OData feeds using LINQPad. Using

  • 0

I am getting to know OData by querying existing OData feeds using LINQPad. Using the Netflix feed, I am attempting to get a list of actors with the most awards, but I am getting strange exceptions. My first attempt was:

People.OrderByDescending(p => p.Awards.Count).Take(10)

But that gave me a 5DataServiceQueryException with an inner exception of:

No property ‘Count’ exists in type ‘System.Collections.Generic.ICollection`1[[Netflix.Catalog.v2.Entities.TitleAward, Netflix.Catalog.v2, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]’ at position 7.

I tried to change things a little, by using the .Count() extension method instead of the .Count property:

People.OrderByDescending(p => p.Awards.Count()).Take(10)

But that just game me an InvalidCastException:

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)
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
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.ResourceBinder.Bind(Expression e)
at System.Data.Services.Client.DataServiceQueryProvider.Translate(Expression e)
at System.Data.Services.Client.DataServiceQuery1.Execute()
at System.Data.Services.Client.DataServiceQuery
1.GetEnumerator()
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.

Any ideas how to perform this simple operation?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T08:41:59+00:00Added an answer on May 26, 2026 at 8:41 am

    You are wanting to make a decision (in this case “order”), based on an aggregate operation (count).
    That kind of aggregate operation is not supported in OData queries (for now?).

    See this this question for more information:
    Collection Exists Criteria in WCF Data Services

    In the end, you would have to deal with filtering/ordering the data in a different way.
    At least 2 possible solutions:

    1. Pull more data down to the client, and filter it there.
    2. If you control the server, then you can expose a specialized service
      operation to return the result (obviously not the case when Netflix
      is your data source)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone know of a good example for getting started with Outlook add-ins using
I'm using Collections.synchronizedCollection in Java to protect a Set that I know is getting
I am getting to know boost::variant. I think this example should work. #include <boost/fusion/sequence.hpp>
I'm currently getting to know Java and OSGi, so I've read a few books.
I'm new to OpenGL. I have written a programm before getting to know OpenGL
I know there has to be a way: I need help getting any hot
I know there are many tutorials out there for getting started in C. However
I know it can be done but am having issues getting it to work.
I'm getting into ASP.NET (C# - I know it doesn't matter for this particular
Hi Anyone know of a simple system of getting xml formatted inside an editor.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.