/// <summary> /// Category Browse page allows filter by facets but we can't filter by sibling category facets. /// </summary> /// <param name="param"></param> /// <param name="node"></param> /// private void CleanSiblingFacets(GetCategoryBrowsingViewModelParam param, CategoryFacetValuesTreeNode node) { var selected = node.ChildNodes?.FirstOrDefault(c => c.IsSelected && c.CategoryId == param.CategoryId); if (selected != null) { node.ChildNodes = node.ChildNodes.Where(c => c.CategoryId == param.CategoryId).ToList(); } node.ChildNodes?.ForEach(childNode => CleanSiblingFacets(param, childNode)); }
private void BuildCategoryUrlsForTreeNode(GetCategoryBrowsingViewModelParam param, CategoryFacetValuesTreeNode node) { node.CategoryUrl = GetCategoryUrl(node.CategoryId, param); node.ChildNodes?.ForEach(childNode => BuildCategoryUrlsForTreeNode(param, childNode)); }