Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
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?
var caseStudyList = caseStudyNodes.Select(c => new CaseStudy(c));
So basically you are going to select each IPublishedContent element and convert it to the strongly typed class CaseStudy.
Have a nice day
ahh Of course!... Thanks Michael
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted