Ejemplo n.º 1
0
        /// <summary>
        /// Configures the api.
        /// </summary>
        /// <param name="modelCache">The optional model cache</param>
        /// <param name="imageProcessor">The optional image processor</param>
        private void Setup(IContentServiceFactory factory, ICache modelCache = null, IImageProcessor imageProcessor = null)
        {
            _cache = modelCache;

            var cacheLevel = (int)App.CacheLevel;

            Aliases    = new AliasRepository(this, _db, cacheLevel > 2 ? _cache : null);
            Archives   = new ArchiveRepository(this, _db);
            Categories = new CategoryRepository(this, _db, cacheLevel > 2 ? _cache : null);
            Media      = new MediaRepository(this, _db, _storage, cacheLevel > 2 ? _cache : null, imageProcessor);
            Pages      = new PageRepository(this, _db, factory, cacheLevel > 2 ? _cache : null);
            PageTypes  = new PageTypeRepository(_db);
            Params     = new ParamRepository(_db, cacheLevel > 0 ? _cache : null);
            Posts      = new PostRepository(this, _db, factory, cacheLevel > 2 ? _cache : null);
            PostTypes  = new PostTypeRepository(_db);
            Sites      = new SiteRepository(this, _db, factory, cacheLevel > 0 ? _cache : null);
            SiteTypes  = new SiteTypeRepository(_db);
            Tags       = new TagRepository(_db, cacheLevel > 2 ? _cache : null);
        }
Ejemplo n.º 2
0
 public SiteTypeService(SiteTypeRepository repository, IProvastSAPUnitOfWork uow)
     : base(repository, uow)
 {
     _repository = repository;
 }