Return Count from Netflix oData Service When the LINQ Count() Method Doesn't Work
- by Craig Shoemaker
Is there a way to use a LINQ expression to request a Count query from the Netflix oData service?
The Netflix documentation shows that you can return counts by appending $count to a request for a collection, but a URL like this:
http://netflix.cloudapp.net/Catalog/Genres/$count
Is not generated from an expression like this:
var count = (from g in catalog.Genres select g).Count();
The above code returns an error saying that the Count method is not supported. Is there a way to do this in LINQ, or do I just need to make WebClient request to get the value?