public SearchController(IPostRepository postRepository, IPostIndexer postIndexer, SiteConfiguration siteConfiguration, ICache postContentCache)
 {
     _postRepository    = postRepository ?? throw new ArgumentNullException(nameof(postRepository));
     _postIndexer       = postIndexer ?? throw new ArgumentNullException(nameof(postIndexer));
     _siteConfiguration = siteConfiguration ?? throw new ArgumentNullException(nameof(siteConfiguration));
     _postContentCache  = postContentCache ?? throw new ArgumentNullException(nameof(postContentCache));
 }
Exemple #2
0
 public RSSController(IPostRepository postRepository, SiteConfiguration siteConfiguration, ICache postContentCache)
 {
     if (siteConfiguration == null)
     {
         throw new ArgumentNullException(nameof(siteConfiguration));
     }
     _postRepository = postRepository ?? throw new ArgumentNullException(nameof(postRepository));
     _maximumNumberOfPostsToPublish = siteConfiguration.MaximumNumberOfPostsToPublishInRssFeed;
     _postContentCache = postContentCache ?? throw new ArgumentNullException(nameof(postContentCache));
 }
Exemple #3
0
 public ViewPostController(IPostRepository postRepository, SiteConfiguration siteConfiguration, ICache postContentCache)
 {
     _postRepository    = postRepository ?? throw new ArgumentNullException(nameof(postRepository));
     _siteConfiguration = siteConfiguration ?? throw new ArgumentNullException(nameof(siteConfiguration));
     _postContentCache  = postContentCache ?? throw new ArgumentNullException(nameof(postContentCache));
 }