コード例 #1
0
        public async Task <IActionResult> UnlinkAttributeValues(ManageAttributesViewModel model)
        {
            ICollection <ProductAttributeValue> pavsToRemove = new List <ProductAttributeValue>();

            foreach (var productAttributeValueId in model.IdsOfSelectedLinks)
            {
                ProductAttributeValue pav = _attributeService.FindProductAttributeValueById(productAttributeValueId);
                pavsToRemove.Add(pav);
            }
            await _attributeService.RemoveProductAttributeValueRange(pavsToRemove);

            return(RedirectToAction("Index"));
        }