Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

440 ArticulateRootNodeCache InvalidOperationException: Sequence contains no matching element #441

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading