예제 #1
0
        public Master(SpaSiteModel site, IPublishedContent content)
        {
            Id = content.Id;

            Title = content.GetSpaTitle();

            Url = content.GetSpaUrl();

            Meta  = SpaMetaData.GetFromContent(site, content);
            Intro = new SpaIntro(content);

            Path      = content.Path.Split(',').Select(x => Convert.ToInt32(x)).Skip(1).ToArray();
            Template  = content.GetTemplateAlias();
            Culture   = content.GetCulture().Name;
            Created   = content.CreateDate;
            Updated   = content.UpdateDate;
            NoCache   = content.GetPropertyValue <bool>(Constants.SkyConstants.Properties.NoCache);
            JsonDebug = content.HasProperty(Constants.SkyConstants.Properties.JsonData) && content.HasValue(Constants.SkyConstants.Properties.JsonData) ? JObject.Parse(content.GetPropertyValue <string>(Constants.SkyConstants.Properties.JsonData).Remove(0, 1)) : null;
        }
예제 #2
0
        private NewsSearchResult(IPublishedContent content) : base(content)
        {
            NewsDate = content.GetPropertyValue(Constants.SkyConstants.Properties.ContentDate, default(DateTime));

            Intro = new SpaIntro(content);
        }