Example #1
0
        public HomeController(IConfigurationManager configurationManager,
                              IConfigurationRepository configRepository,
                              IFrontMatterRepository frontMatterRepository,
                              IMarkupProcessorFactory markupProcessorFactory)
            : base(configurationManager)
        {
            if (configRepository == null)
            {
                throw new ArgumentNullException("configRepository");
            }

            if (frontMatterRepository == null)
            {
                throw new ArgumentNullException("frontMatterRepository");
            }

            if (markupProcessorFactory == null)
            {
                throw new ArgumentNullException("markupProcessorFactory");
            }

            ConfigRepository       = configRepository;
            FrontMatterRepository  = frontMatterRepository;
            MarkupProcessorFactory = markupProcessorFactory;
        }
Example #2
0
 public PageOfPostsViewModel(PageOf<IFrontMatter, FrontMatterSearchCriteria> entity, IMarkupProcessorFactory markupProcessorFactory)
 {
     Count = entity.Count;
     Entities = entity.Entities.Select(e => new PostViewModel(e, markupProcessorFactory)).ToList();
     SearchCriteria = new PostSearchCriteriaViewModel(entity.SearchCriteria);
     TotalCount = entity.TotalCount;
 }
Example #3
0
        public UrlController(IConfigurationManager configurationManager,
            IConfigurationRepository configRepository, 
            IFrontMatterRepository frontMatterRepository,
            IMarkupProcessorFactory markupProcessorFactory)
            : base(configurationManager)
        {
            if (configRepository == null)
            {
                throw new ArgumentNullException("configRepository");
            }

            if (frontMatterRepository == null)
            {
                throw new ArgumentNullException("frontMatterRepository");
            }

            if (markupProcessorFactory == null)
            {
                throw new ArgumentNullException("markupProcessorFactory");
            }

            ConfigRepository = configRepository;
            FrontMatterRepository = frontMatterRepository;
            MarkupProcessorFactory = markupProcessorFactory;
        }
Example #4
0
 public ContentViewModel(IFrontMatter entity, IMarkupProcessorFactory markupProcessorFactory)
 {
     Date = entity.DateTime.HasValue ? entity.DateTime.Value : DateTimeOffset.MinValue;
     Title = entity.Title;
     Content = entity.Content;
     ContentType = entity.ContentType.ToString();
     HtmlContent = markupProcessorFactory.CreateInstance(entity.ContentType).Process(Content);
     Permalinks = entity.Permalinks;
     Tags = entity.Tags;
 }
Example #5
0
 public ContentViewModel(IFrontMatter entity, IMarkupProcessorFactory markupProcessorFactory)
 {
     Date        = entity.DateTime.HasValue ? entity.DateTime.Value : DateTimeOffset.MinValue;
     Title       = entity.Title;
     Content     = entity.Content;
     ContentType = entity.ContentType.ToString();
     HtmlContent = markupProcessorFactory.CreateInstance(entity.ContentType).Process(Content);
     Permalinks  = entity.Permalinks;
     Tags        = entity.Tags;
 }
Example #6
0
 public PostViewModel(IFrontMatter entity, IMarkupProcessorFactory markupProcessorFactory)
     : base(entity, markupProcessorFactory)
 {
 }
Example #7
0
 public PageOfPostsViewModel(PageOf <IFrontMatter, FrontMatterSearchCriteria> entity, IMarkupProcessorFactory markupProcessorFactory)
 {
     Count          = entity.Count;
     Entities       = entity.Entities.Select(e => new PostViewModel(e, markupProcessorFactory)).ToList();
     SearchCriteria = new PostSearchCriteriaViewModel(entity.SearchCriteria);
     TotalCount     = entity.TotalCount;
 }
Example #8
0
 public PostViewModel(IFrontMatter entity, IMarkupProcessorFactory markupProcessorFactory)
     : base(entity, markupProcessorFactory)
 {
 }