diff --git a/Lombiq.HelpfulLibraries.OrchardCore/ResourceManagement/ResourceFilterBuilder.cs b/Lombiq.HelpfulLibraries.OrchardCore/ResourceManagement/ResourceFilterBuilder.cs index 3fa92118..2376ea8b 100644 --- a/Lombiq.HelpfulLibraries.OrchardCore/ResourceManagement/ResourceFilterBuilder.cs +++ b/Lombiq.HelpfulLibraries.OrchardCore/ResourceManagement/ResourceFilterBuilder.cs @@ -47,10 +47,15 @@ public ResourceFilter When(Func> filterAsync) } /// - /// Adds a filter that matches the given to the list of . + /// Adds a filter that matches any of the provided to the list of + /// . /// - public ResourceFilter WhenPath(string path) => - When(context => context.Request.Path.Value?.Trim('/').EqualsOrdinalIgnoreCase(path.Trim('/')) == true); + public ResourceFilter WhenPath(params string[] paths) + { + var trimmedPaths = paths.Select(path => path.Trim('/')); + return When(context => + trimmedPaths.Contains(context.Request.Path.Value?.Trim('/'), StringComparer.OrdinalIgnoreCase)); + } /// /// Adds a filter that matches the path of the homepage ("/") to the list of .