private void EditAttributeForChildrenCacade(string oldName, string newName, Category category) { if (category == null) { return; } if (!category.Children.Any()) { return; } var children = _categoryService.GetByParenId(category.Id); foreach (var child in children.Where(child => _categoryService.HasAttributeByName(oldName, child.Id))) { _attributeService.EditByCategoryId(oldName, newName, child.Id); } }