public void DeleteProductAttribute(int productAttributeId)
        {
            //Get productAttribute by id.
            var productAttribute = productAttributeRepository.GetById(productAttributeId);

            if (productAttribute != null)
            {
                productAttributeRepository.Delete(productAttribute);
                SaveProductAttribute();
            }
        }
Beispiel #2
0
        /// <summary>
        /// Deletes a product attribute
        /// </summary>
        /// <param name="productAttribute">Product attribute</param>
        public virtual void DeleteProductAttribute(ProductAttribute productAttribute)
        {
            if (productAttribute == null)
            {
                throw new ArgumentNullException("productAttribute");
            }

            _productAttributeRepository.Delete(productAttribute);

            //cache
            _cacheManager.GetCache(CACHE_NAME_PRODUCTATTRIBUTES).Clear();
            _cacheManager.GetCache(CACHE_NAME_PRODUCTATTRIBUTEMAPPINGS).Clear();
            _cacheManager.GetCache(CACHE_NAME_PRODUCTATTRIBUTEVALUES).Clear();
            _cacheManager.GetCache(CACHE_NAME_PRODUCTATTRIBUTECOMBINATIONS).Clear();

            //event notification
            //_eventPublisher.EntityDeleted(productAttribute);
        }