protected void ItemDo(ConfigurationItem item)
 {
     switch (item.Name)
     {
     case "Global:ReadOnlyMode":
         categoriesCache.Initialize();
         return;
     }
 }
예제 #2
0
        public IActionResult ResetAllCache()
        {
            componentsCache.Initialize();
            categoriesCache.Initialize();
            menuCache.Initialize();
            rolesCache.Initialize();
            contentCache.Reset();
            spamProtectionCache.Reset();
            mailTemplatesCache.Initialize();
            dynamicConfigCache.Initialize();
            configurationRoot.Reload();

            return(Ok());
        }
예제 #3
0
        public async ValueTask <IActionResult> CreateCategory([FromBody] CategoryRequestModel categoryData)
        {
            if (!ModelState.IsValid)
            {
                return(ValidationProblem());
            }

            var category = categoryData.ToCategory();

            await categoriesAdminManager.CreateCategoryAsync(category);

            categoriesCache.Initialize();
            contentCache.Reset();

            return(Ok());
        }