sitecore - Glass mapper does not load item childeren -
we facing issue in glass mapper 4.0 not load item children.
here our controller class , inheriting glasscontroller:
public class carouselcontroller : glasscontroller { public actionresult getcarousel() { model = this.getdatasourceitem<carouselviewmodel>(); return view(model); } }
and here our view model:
public class carouselviewmodel:carousel_folder { [sitecorechildren] public virtual ienumerable<carousel> carousels { get; set; } }
we parent node information not childeren (carousels) in result
here result get:
[result image][1]
also, following classes generated tds:
[sitecoretype(templateid = icarousel_folderconstants.templateidstring )] //, cachable = true public partial interface icarousel_folder : iglassbase {}
carousel template inheriting 2 templates content base , image base.
i had issue before, me added [sitecorechildren(islazy = false)]
model , works fine, in case should :
public class carouselviewmodel:carousel_folder { [sitecorechildren(islazy = false)] public virtual ienumerable<carousel> carousels { get; set; } }
Comments
Post a Comment