/// <summary> /// Default constructor. /// </summary> /// <param name="api">The current api</param> /// <param name="db">The current db context</param> /// <param name="factory">The content service factory</param> /// <param name="cache">The optional model cache</param> public PageRepository(IApi api, IDb db, IContentServiceFactory factory, ICache cache = null) { _api = api; _db = db; _contentService = factory.CreatePageService(); _cache = cache; }
/// <summary> /// Default constructor. /// </summary> /// <param name="api">The current api</param> /// <param name="db">The current db connection</param> /// <param name="factory">The current content service factory</param> /// <param name="cache">The optional model cache</param> public PostRepository(IApi api, IDb db, IContentServiceFactory factory, ICache cache = null) { this.db = db; this.api = api; this.contentService = factory.CreatePostService(); this.cache = cache; }
/// <summary> /// Default constructor. /// </summary> /// <param name="db">The current db context</param> /// <param name="factory">The content service factory</param> /// <param name="storage">The current storage</param> /// <param name="modelCache">The optional model cache</param> /// <param name="imageProcessor">The optional image processor</param> public Api(IDb db, IContentServiceFactory factory, IStorage storage = null, ICache modelCache = null, IImageProcessor imageProcessor = null) { _db = db; _storage = storage; Setup(factory, modelCache, imageProcessor); }
/// <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, cacheLevel > 1 ? cache : null); Params = new ParamRepository(db, cacheLevel > 0 ? cache : null); Posts = new PostRepository(this, db, factory, cacheLevel > 2 ? cache : null); PostTypes = new PostTypeRepository(db, cacheLevel > 1 ? cache : null); Sites = new SiteRepository(this, db, cacheLevel > 0 ? cache : null); Tags = new TagRepository(db, cacheLevel > 2 ? cache : null); }
/// <summary> /// Default constructor. /// </summary> /// <param name="db">The current db connection</param> /// <param name="factory">The content service factory</param> public ContentRepository(IDb db, IContentServiceFactory factory) { _db = db; _service = factory.CreateContentService(); }
/// <summary> /// Default constructor. /// </summary> /// <param name="api">The current api</param> /// <param name="editService">The current page edit service</param> /// <param name="factory">The content service factory</param> public PageController(IApi api, PageEditService editService, IContentServiceFactory factory) : base(api) { this.editService = editService; this.contentService = factory.CreatePageService(); }
/// <summary> /// Default constructor. /// </summary> /// <param name="api">The current api</param> /// <param name="factory">The content service factory</param> public BlockController(IApi api, IContentServiceFactory factory) : base(api) { // Block transformation is not dependent on which content // type is actually selected, so let's create a page service. this.contentService = factory.CreatePageService(); }
/// <summary> /// Default constructor. /// </summary> /// <param name="api">The current api</param> public PostController(IApi api, PostEditService editService, IContentServiceFactory factory, IHubContext <Hubs.PreviewHub> hub) : base(api) { this.editService = editService; this.contentService = factory.CreatePostService(); _hub = hub; }
/// <summary> /// Default constructor. /// </summary> /// <param name="db">The current db context</param> /// <param name="factory">The content service factory</param> public SiteRepository(IDb db, IContentServiceFactory factory) { _db = db; _contentService = factory.CreateSiteService(); }
public PageEditService(IApi api, IContentServiceFactory factory) { _api = api; _service = factory.CreatePageService(); }
public SiteContentEditService(IApi api, IContentServiceFactory factory) { this.api = api; service = factory.CreateSiteService(); }
/// <summary> /// Default constructor. /// </summary> /// <param name="api">The current api</param> /// <param name="db">The current db context</param> /// <param name="factory">The content service factory</param> /// <param name="cache">The optional model cache</param> public SiteRepository(Api api, IDb db, IContentServiceFactory factory, ICache cache = null) : base(db, cache) { this.api = api; this.contentService = factory.CreateSiteService(); }
public ExtendedPageRepository(IDb db, IContentServiceFactory factory) : base(db, factory) { _db = db; }
/// <summary> /// Default constructor. /// </summary> /// <param name="api">The current api</param> /// <param name="db">The current db context</param> /// <param name="factory">The content service factory</param> /// <param name="cache">The optional model cache</param> public SiteRepository(Api api, IDb db, IContentServiceFactory factory, ICache cache = null) : base(db, cache) { this.api = api; this.contentService = factory.Create <Site, SiteField, Models.SiteContentBase>(); }
/// <summary> /// Default constructor. /// </summary> /// <param name="api">The current api</param> public SiteController(IApi api, SiteContentEditService service, IContentServiceFactory factory) : base(api) { _service = service; _contentService = factory.CreateSiteService(); }
public PageRepository(ISessionFactory sessionFactory, IContentServiceFactory factory, IMapper mapper) : base(sessionFactory) { _contentService = factory.CreatePageService(); _mapper = mapper; }
public PostEditService(IApi api, IContentServiceFactory factory) { this.api = api; service = factory.CreatePostService(); }
public SiteRepository(ISessionFactory sessionFactory, IContentServiceFactory factory) : base(sessionFactory) { _contentService = factory.CreateSiteService(); }
/// <summary> /// Default constructor. /// </summary> /// <param name="db">The current db connection</param> /// <param name="factory">The current content service factory</param> public PostRepository(IDb db, IContentServiceFactory factory) { _db = db; _contentService = factory.CreatePostService(); }
/// <summary> /// Default constructor. /// </summary> /// <param name="api">The current api</param> /// <param name="editService">The current page edit service</param> /// <param name="factory">The content service factory</param> public PageController(IApi api, PageEditService editService, IContentServiceFactory factory, IHubContext <Hubs.PreviewHub> hub) : base(api) { _editService = editService; _contentService = factory.CreatePageService(); _hub = hub; }