コード例 #1
0
        private ContentPublished Publish(int contentId)
        {
            Content c = _contentRepository.Get(contentId);

            if (c == null)
            {
                throw new Exception("Not valid content.");
            }

            IDictionary <string, object> propertyValues = new Dictionary <string, object>();

            propertyValues.Add("Content", c);
            ContentPublished pc = _contentPublishedRepository.FindOne(propertyValues);

            if (pc != null)
            {
                _contentPublishedRepository.Delete(pc);
            }

            pc = ContentPublishedFactory.CreateFromContent(c);
            _contentPublishedRepository.SaveOrUpdate(pc);

            c.LastContentPublished = pc;

            return(pc);
        }
コード例 #2
0
 protected Task On(ContentPublished @event, EnvelopeHeaders headers)
 {
     return(ForSchemaIdAsync(@event.SchemaId.Id, collection =>
     {
         return collection.UpdateAsync(@event, headers, x =>
         {
             x.IsPublished = true;
         });
     }));
 }
コード例 #3
0
 protected void On(ContentPublished @event)
 {
     isPublished = true;
 }
コード例 #4
0
        public ActionResult SiteMap()
        {
            ContentPublished c = contentService.Get(new ContentCategory(12), ContentType.Private);

            return(View("Private", c));
        }
コード例 #5
0
        public ActionResult TermsOfUse()
        {
            ContentPublished c = contentService.Get(new ContentCategory(10), ContentType.Private);

            return(View("Private", c));
        }
コード例 #6
0
        public ActionResult Recommendations()
        {
            ContentPublished c = contentService.Get(new ContentCategory(13), ContentType.Private);

            return(View("Private", c));
        }
コード例 #7
0
        public ActionResult AboutUs()
        {
            ContentPublished c = contentService.Get(new ContentCategory(4), ContentType.Private);

            return(View("Private", c));
        }