Distinct Years from CommonPartRecord

Topics: General
May 15, 2015 at 2: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")
May 15, 2015 at 5: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 12:51 PM
May 18, 2015 at 3:41 PM
This seems to be the exact same question as posted here: http://orchardpros.net/tickets/7021