Skip to content

Commit 2c5b687

Browse files
committed
Fixed logic for validationDelegate
In a previous commit, I fixed a bug on when the `validationDelegate()` was called (64813c7). This resulted in more intuitive and flexible behavior that aligns with the documented functionality. In doing so, however, it potentially breaks implementations—including that in the `MenuViewComponentBase<T>`. As the `validationDelegate()` is now being called correctly on each individual topic, instead of on the parent topic, we need to evaluate the content type of the parent topic in order to filter out children of the `PageGroup` content type. While I was at it, I updated the logic to use C# 9.0's pattern matching syntax.
1 parent 64813c7 commit 2c5b687

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

OnTopic.AspNetCore.Mvc/Components/MenuViewComponentBase{T}.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ IHierarchicalTopicMappingService<T> hierarchicalTopicMappingService
102102
await HierarchicalTopicMappingService.GetRootViewModelAsync(
103103
navigationRootTopic!,
104104
3,
105-
t => t.ContentType is not "PageGroup"
105+
t => t is not { Parent: { ContentType: "PageGroup" } }
106106
).ConfigureAwait(false);
107107

108108
/*==========================================================================================================================

0 commit comments

Comments
 (0)