Distinct Years from CommonPartRecord

Topics: General
May 15, 2015 at 3:29 PM
I'm trying to get a list of Distinct Years from CommonPartRecord CreatedUtc but not sure how to get it done.

Basically i have this line of code to query items of some XYZ Content type and not sure how to get distinct years from this without first doing a .List() operation. There are hundreds of records for each year and it is required to do the Distinct operation within the DB itself i.e. before doing .List()

Please guide.
_contentManager.Query<CommonPart, CommonPartRecord>("XYZ")
Developer
May 15, 2015 at 6:26 PM
I'm afraid this is not possible with ContentQuery, maybe with IHqlQuery. But then again content querying in Orchard has its shortcomings, that's one of the reasons we want to design a new one soon.
May 18, 2015 at 1:51 PM
Thanks.
Developer
May 18, 2015 at 4:41 PM
This seems to be the exact same question as posted here: http://orchardpros.net/tickets/7021