Why isn't my Enumerable getting populated by Glass.Mapper?

后端 未结 1 1867
无人及你
无人及你 2021-01-25 17:54

I\'m totally confused as to why this isn\'t working. I have a class with a list of other classes as a property of it:

public class Widget
{
     ....
     public         


        
相关标签:
1条回答
  • 2021-01-25 18:27

    I got a solution, don't ask me why this works because I found it though trial and error. Basically doing this seemed to make it work:

    [SitecoreType(AutoMap =true)]
    public class Widget
    {
         ....
         [SitecoreField(FieldType =SitecoreFieldType.TreelistEx)]
         public virtual IEnumerable<WidgetButton> Buttons { get; set; }
    }
    

    specifically I think specifying the FieldType.

    0 讨论(0)
提交回复
热议问题