示例#1
0
        public SpeakerModel(DynamicContent sfContent)
            : base(sfContent)
        {
            if (sfContent != null)
            {
                // Set custom properties
                Email     = sfContent.GetStringSafe("Email");
                Bio       = sfContent.GetStringSafe("Bio");
                FirstName = sfContent.GetStringSafe("FirstName");
                LastName  = sfContent.GetStringSafe("LastName");
                Company   = sfContent.GetStringSafe("Company");
                Position  = sfContent.GetStringSafe("Position");
                Twitter   = sfContent.GetStringSafe("Twitter");
                Website   = sfContent.GetStringSafe("Website");
                Photo     = sfContent.GetImage("Photo");
                eBooks    = sfContent.GetDocuments("Ebooks");

                // TODO: Create Baba extension if possible
                Sessions = sfContent.GetOriginal().GetRelatedItems <DynamicContent>("Sessions")
                           .Select(x => new SessionModel(x))
                           .ToList();

                Categories = sfContent.GetTaxa("Category");
                Tags       = sfContent.GetTaxa("Tags");
            }
        }