This project is read-only.

To query ContentPart by record id which base on ContentPartVersionRecord

Topics: Customizing Orchard
Dec 4, 2014 at 8:08 AM
Hi Everybody

I have designed a contentpart which is base on ContentPartVersionRecord. So its id is ContentItemVersionRecord's ID. I am tring to get contentpart from record id by ContentManger.
But always get null value. How to do ?
Dec 4, 2014 at 8:34 AM

I have tried:

_services.ContentManager.HqlQuery().ForPart<DocumentPart>().List().Where(d => d.Record.Id == docPartId).Single();

DocumentPart is my contentpart, docPartId is my documentpartrecord's id

Dec 5, 2014 at 3:42 AM
Try querying by the content item ID, not the version record ID.