Skip to content

Commit

Permalink
Merge pull request #441 from nvisage-gf/440-articulaterootnodecache-i…
Browse files Browse the repository at this point in the history
…nvalidopera

440 ArticulateRootNodeCache InvalidOperationException: Sequence contains no matching element
  • Loading branch information
Shazwazza authored Feb 8, 2024
2 parents d13a014 + fff26a4 commit 7995770
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Articulate/Routing/ArticulateRouter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,14 @@ private void MapRoute(
_routeCache[art] = dynamicRouteValues;
}

dynamicRouteValues.Add(articulateRootNode.Id, domains.Where(x => x.ContentId == articulateRootNode.Id).ToList());
dynamicRouteValues.Add(articulateRootNode.Id, DomainsForContent(articulateRootNode,domains));
}

private List<Domain> DomainsForContent(IPublishedContent content, IReadOnlyList<Domain> domains)
{
var nodePaths = new HashSet<int>(content.Path.Split(",").Select(int.Parse).ToList());

return domains.Where(domain => nodePaths.Contains(domain.ContentId)).ToList();
}

private void MapOpenSearchRoute(HttpContext httpContext, string rootNodePath, IPublishedContent articulateRootNode, List<Domain> domains)
Expand Down

0 comments on commit 7995770

Please sign in to comment.