public void DeleteProductAttributeMapping(int productAttributeMappingId) { //Get productAttributeMapping by id. var productAttributeMapping = productAttributeMappingRepository.GetById(productAttributeMappingId); if (productAttributeMapping != null) { productAttributeMappingRepository.Delete(productAttributeMapping); SaveProductAttributeMapping(); } }
/// <summary> /// Deletes a product attribute mapping /// </summary> /// <param name="productAttributeMapping">Product attribute mapping</param> public virtual void DeleteProductAttributeMapping(ProductAttributeMapping productAttributeMapping) { if (productAttributeMapping == null) { throw new ArgumentNullException("productAttributeMapping"); } _productAttributeMappingRepository.Delete(productAttributeMapping); //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(productAttributeMapping); }