How to convert IPublisedContent list to Strongly typed List - Model Builder.
I'm using the Models Builder to create C# classes for all my document types, in my custom controller I am retriving all the content nodes that are of a specfic type:
var viewModel = new HomePageViewModel(model);
var caseStudyNodes = viewModel.Content.AncestorOrSelf().Descendants(CaseStudy.ModelTypeAlias).ToList();
the caseStudyNodes variable is now a list of IPublished content. Is there a way to get this as a list of CaseStudy objects?
How to convert IPublisedContent list to Strongly typed List - Model Builder.
I'm using the Models Builder to create C# classes for all my document types, in my custom controller I am retriving all the content nodes that are of a specfic type:
the caseStudyNodes variable is now a list of IPublished content. Is there a way to get this as a list of CaseStudy objects?
Hi Ayo,
try this:
So basically you are going to select each
IPublishedContent
element and convert it to the strongly typed classCaseStudy
.Have a nice day
/Michaël
ahh Of course!... Thanks Michael
No problem!
/Michaël
is working on a reply...