Sep 10, 2014 at 2:28 AM
Edited Sep 10, 2014 at 2:29 AM
I think we need more context.
What do you want to accomplish?
Where do you call the IContentManager? (Driver, Controller, View??) - As far as I know it should be the first or second choice. Using the ContentManager in the view is not a good practice.
If you specify your ContentItem search you can use the ".Query<TPart>" Method.
For example like this:
I want all the ContentItems which have a CommonPart attachted and where the Container.Id from this CommonPart is equal to my linkGroup.Id and order them by the Position Field from the ContainablePart.
parentContentItem.ChildItems = _contentManager.Query<CommonPart, CommonPartRecord>()
.Where(c => c.Container.Id == linkGroup.Id)
.Select(item => item.ContentItem)
.OrderByDescending(c => c.As<ContainablePart>().Position);