public bool AddProductToGroups(IEnumerable <ProductGroup> productGroups, int productID) { _productGroupRepository.DeleteMulti(x => x.ProductID == productID); foreach (var productGroup in productGroups) { _productGroupRepository.Add(productGroup); } return(true); }