Ejemplo n.º 1
0
        private CategoriesAdminManager DefaultCategoryAdminManager()
        {
            var dbFactory = DefaultInit.GetTestDataBaseFactory();
            var catCache  = new CategoriesCache(dbFactory);

            return(new CategoriesAdminManager(dbConnection, catCache, new Sanitizer()));
        }
        private CategoriesAdminManager DefaultCategoryAdminManager()
        {
            var dbFactory = DefaultInit.GetTestDataBaseFactory();
            var catCache  = new CategoriesCache(dbFactory);

            /*return new CategoriesAdminManager(dbConnection,
             *  Options.Create(new MaterialsOptions {SubTitleLength = 100, PreviewLength = 800}), catCache,
             *  new Sanitizer(new SanitizerOptions()));*/

            throw new NotSupportedException("Need moq SanitizerService");
        }
Ejemplo n.º 3
0
        private CategoriesAdminManager DefaultCategoryAdminManager()
        {
            var dbFactory = DefaultInit.GetTestDataBaseFactory();
            var catCache  = new CategoriesCache(dbFactory);

            return(new CategoriesAdminManager(dbConnection,
                                              Options.Create(new MaterialsOptions {
                SubTitleLength = 100, PreviewLength = 800
            }), catCache,
                                              new Sanitizer()));
        }
        private CacheSettingsManager InitializeDefaultSettingsManager()
        {
            var serviceCollection = new ServiceCollection();

            serviceCollection.AddOptions <IOptions <CacheOptions> >();
            serviceCollection.AddMemoryCache();
            var serviceProvider = serviceCollection.BuildServiceProvider();

            var categoriesCache = new CategoriesCache(DefaultInit.GetTestDataBaseFactory());
            var cacheOptions    = serviceProvider.GetRequiredService <IOptions <CacheOptions> >();
            var contentCache    = new CategoryContentCache(categoriesCache, serviceProvider.GetRequiredService <IMemoryCache>(), serviceProvider.GetRequiredService <IOptions <CacheOptions> >());

            return(new CacheSettingsManager(cacheOptions, contentCache, dbConnection));
        }
Ejemplo n.º 5
0
 public ItemController(IItemRepository itemRepository, CategoriesCache cache)
 {
     this.itemRepository = itemRepository;
     this.cache          = cache;
 }
 public CategoryController(ICategoryRepository categoryRepository, CategoriesCache cache)
 {
     this.categoryRepository = categoryRepository;
     this.cache = cache;
 }
Ejemplo n.º 7
0
 public CategoryItemsStockChangedHandler(IItemRepository itemrepository, CategoriesCache cache)
 {
     this.itemrepository = itemrepository;
     this.cache          = cache;
 }