Unfortunately, the metadata of the UGC WebService is not correct in regards to the ItemsStats. For you it means that the webservice metadata does not expose the fact that the ItemStat entity contains the LastRatedDate
property. This makes your .NET proxies not to be aware of this property and makes your query fail.
To work-around this defect you have two option:
- Add to your service the following property:
cds.IgnoreMissingProperties = true
;. Advantage of this approach is that you're done with it in 2 sec. Disadvantage is that you will not be able to access that property (in case you actually use it); - Modify the proxies generated by Visual Studio and manually add that property to the ItemStat class. Advantage of this approach is that you will be able to access the property from your project. Disadvantage is that it's totally not manageable from the coding point of view, you need to be careful when you upgrade or regenerate the proxies and it's easy to make a mistake while manually adding the property.
Note 1: to access the metadata of your webServer from the browser your can go to /odata.svc/$metadata
.
Note 2: on a closer look there are 2 properties missing from the webService metadata: LastRatedDate
and LastCommentedDate
.
Hope this helps.