aboutsummaryrefslogtreecommitdiff
path: root/plugins/VNLib.Plugins.Essentials.Content.Routing/src
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/VNLib.Plugins.Essentials.Content.Routing/src')
-rw-r--r--plugins/VNLib.Plugins.Essentials.Content.Routing/src/Router.cs17
1 files changed, 5 insertions, 12 deletions
diff --git a/plugins/VNLib.Plugins.Essentials.Content.Routing/src/Router.cs b/plugins/VNLib.Plugins.Essentials.Content.Routing/src/Router.cs
index fda572a..72f091a 100644
--- a/plugins/VNLib.Plugins.Essentials.Content.Routing/src/Router.cs
+++ b/plugins/VNLib.Plugins.Essentials.Content.Routing/src/Router.cs
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2023 Vaughn Nugent
+* Copyright (c) 2024 Vaughn Nugent
*
* Library: VNLib
* Package: VNLib.Plugins.Essentials.Content.Routing
@@ -41,21 +41,14 @@ using VNLib.Plugins.Essentials.Content.Routing.Model;
namespace VNLib.Plugins.Essentials.Content.Routing
{
- internal sealed class Router : IPageRouter
+ internal sealed class Router(PluginBase plugin) : IPageRouter
{
private static readonly RouteComparer Comparer = new();
- private readonly IRouteStore Store;
- private readonly ILogProvider Logger;
+ private readonly IRouteStore Store = plugin.GetOrCreateSingleton<ManagedRouteStore>();
+ private readonly ILogProvider Logger = plugin.Log;
- private readonly ConcurrentDictionary<IWebProcessor, Task<ReadOnlyCollection<Route>>> RouteTable;
-
- public Router(PluginBase plugin)
- {
- Store = plugin.GetOrCreateSingleton<ManagedRouteStore>();
- Logger = plugin.Log;
- RouteTable = new();
- }
+ private readonly ConcurrentDictionary<IWebProcessor, Task<ReadOnlyCollection<Route>>> RouteTable = new();
public Router(PluginBase plugin, IConfigScope config):this(plugin)
{ }