Beispiel #1
0
        /// <summary>
        /// Creates a new api from the currently registered
        /// repositories.
        /// </summary>
        public Api(
            IContentFactory contentFactory,
            IAliasRepository aliasRepository,
            IArchiveRepository archiveRepository,
            IMediaRepository mediaRepository,
            IPageRepository pageRepository,
            IPageTypeRepository pageTypeRepository,
            IParamRepository paramRepository,
            IPostRepository postRepository,
            IPostTypeRepository postTypeRepository,
            ISiteRepository siteRepository,
            ISiteTypeRepository siteTypeRepository,
            ICache cache              = null,
            IStorage storage          = null,
            IImageProcessor processor = null)
        {
            // Store the cache
            _cache = cache;

            // Create services without dependecies
            PageTypes = new PageTypeService(pageTypeRepository, cache);
            Params    = new ParamService(paramRepository, cache);
            PostTypes = new PostTypeService(postTypeRepository, cache);
            Sites     = new SiteService(siteRepository, contentFactory, cache);
            SiteTypes = new SiteTypeService(siteTypeRepository, cache);

            // Create services with dependencies
            Aliases  = new AliasService(aliasRepository, Sites, cache);
            Media    = new MediaService(mediaRepository, Params, storage, processor, cache);
            Pages    = new PageService(pageRepository, contentFactory, Sites, Params, cache);
            Posts    = new PostService(postRepository, contentFactory, Sites, Pages, cache);
            Archives = new ArchiveService(archiveRepository, Params, Posts);
        }
Beispiel #2
0
        /// <summary>
        /// Default constructor.
        /// </summary>
        /// <param name="repo">The main repository</param>
        /// <param name="cache">The optional model cache</param>
        public SiteTypeService(ISiteTypeRepository repo, ICache cache)
        {
            _repo = repo;

            if ((int)App.CacheLevel > 1)
            {
                _cache = cache;
            }
        }
Beispiel #3
0
 public SiteTypeService(ISiteTypeRepository repo, ICache cache)
 {
     base();
     this._repo = repo;
     if (App.get_CacheLevel() > 1)
     {
         this._cache = cache;
     }
     return;
 }
Beispiel #4
0
 public SiteTypesController(ISiteTypeRepository siteTypeRepository, IMapper mapper, IPropertyMappingService propertyMappingService,
                            IPropertyCheckerService propertyCheckerService)
 {
     _siteTypeRepository = siteTypeRepository ??
                           throw new ArgumentNullException(nameof(siteTypeRepository));
     _mapper = mapper ??
               throw new ArgumentNullException(nameof(mapper));
     _propertyMappingService = propertyMappingService ??
                               throw new ArgumentNullException(nameof(propertyMappingService));
     _propertyCheckerService = propertyCheckerService ??
                               throw new ArgumentNullException(nameof(propertyCheckerService));
 }
Beispiel #5
0
 public Api(IContentFactory contentFactory, IAliasRepository aliasRepository, IArchiveRepository archiveRepository, IMediaRepository mediaRepository, IPageRepository pageRepository, IPageTypeRepository pageTypeRepository, IParamRepository paramRepository, IPostRepository postRepository, IPostTypeRepository postTypeRepository, ISiteRepository siteRepository, ISiteTypeRepository siteTypeRepository, ICache cache = null, IStorage storage = null, IImageProcessor processor = null, ISearch search = null)
 {
     base();
     this._cache = cache;
     this.u003cPageTypesu003ek__BackingField = new PageTypeService(pageTypeRepository, cache);
     this.u003cParamsu003ek__BackingField    = new ParamService(paramRepository, cache);
     this.u003cPostTypesu003ek__BackingField = new PostTypeService(postTypeRepository, cache);
     this.u003cSitesu003ek__BackingField     = new SiteService(siteRepository, contentFactory, cache);
     this.u003cSiteTypesu003ek__BackingField = new SiteTypeService(siteTypeRepository, cache);
     this.u003cAliasesu003ek__BackingField   = new AliasService(aliasRepository, this.get_Sites(), cache);
     this.u003cMediau003ek__BackingField     = new MediaService(mediaRepository, this.get_Params(), storage, processor, cache);
     this.u003cPagesu003ek__BackingField     = new PageService(pageRepository, contentFactory, this.get_Sites(), this.get_Params(), this.get_Media(), cache, search);
     this.u003cPostsu003ek__BackingField     = new PostService(postRepository, contentFactory, this.get_Sites(), this.get_Pages(), this.get_Params(), this.get_Media(), cache, search);
     this.u003cArchivesu003ek__BackingField  = new ArchiveService(archiveRepository, this.get_Params(), this.get_Posts());
     return;
 }