The use case is the following: retrieve the 5 latest posts.
I am trying to get OData results sorted by a Custom Component Metadata date field, but the statement below breaks.
var pres = service.Components.OrderBy(c => c.CustomMetas.DateValue);
The error thrown is the following:
Error translating Linq expression to URI: The expression .CustomMetas.get_Item.DateValue is not supported.
Obviously I can always sort the data after retrieving the results, however this shouldn't be done for this use case since there could be thousands of results and we would need to parse them, this is far from efficient.
---- EDIT ----
Thanks to Nickoli I got to get it working.
The information I am retrieving matches the following criteria:
- Filter by schema 468
- 5 entries
- Results sorted descending based on Custom Meta date field (ReleaseDate)
The URI looks like this: