Oct 22, 2011 at 8:08 AM
Edited Oct 22, 2011 at 1:25 PM
Oh my God! It seems that I am completely out of sync!
It is true, I needed to reference the ImageField assembly but after doing that, I only get null for image field even if there was an image. But hey! Do I really need to reference the assembly and casting the results to the correct type!? I don't think that
I am doing it correctly.
Besides, it seems that the object that I am getting is not populated with anything!!
Forget everything that I wrote in my earlier post and please assist me in this scenario:
1- I am using this query to get the list of blogposts: (this is the same query of the Recent Content module, so I didn't write anything here)
var contentTypes = _contentManager.GetContentTypeDefinitions()
.Where(x => x.Parts.Any(p => p.PartDefinition.Name == part.ForContentPart))
.Select(x => x.Name)
var query =_contentManager.Query(VersionOptions.Published, contentTypes)
2- then I am getting the count and list of results by :
int count = query.Count();
var queryResults = query.List().ToList() ;
3- Now suppose that I want to get the Image field of the blogpost for item queryResults, what shall I write??