diff options
author | vnugent <public@vaughnnugent.com> | 2024-09-17 14:32:41 -0400 |
---|---|---|
committer | vnugent <public@vaughnnugent.com> | 2024-09-17 14:32:41 -0400 |
commit | b2ab9035c186dd6bb9bc6268a6799b86f369d657 (patch) | |
tree | 3d1f01e28ad808bd636c31612c9ca3c277c2b986 /plugins/VNLib.Plugins.Essentials.Content.Routing/src | |
parent | 1d634e5ba715c2b42583266747fa5c8ab56abd5f (diff) |
test some mvc extensions updatesdevelop
Diffstat (limited to 'plugins/VNLib.Plugins.Essentials.Content.Routing/src')
-rw-r--r-- | plugins/VNLib.Plugins.Essentials.Content.Routing/src/ManagedRouteStore.cs | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/plugins/VNLib.Plugins.Essentials.Content.Routing/src/ManagedRouteStore.cs b/plugins/VNLib.Plugins.Essentials.Content.Routing/src/ManagedRouteStore.cs index 8c32e71..65b115c 100644 --- a/plugins/VNLib.Plugins.Essentials.Content.Routing/src/ManagedRouteStore.cs +++ b/plugins/VNLib.Plugins.Essentials.Content.Routing/src/ManagedRouteStore.cs @@ -26,6 +26,7 @@ using System.Threading; using System.Threading.Tasks; using System.Collections.Generic; +using VNLib.Utils.Logging; using VNLib.Plugins.Extensions.Loading; using VNLib.Plugins.Extensions.Loading.Sql; using VNLib.Plugins.Essentials.Content.Routing.Model; @@ -33,10 +34,16 @@ using VNLib.Plugins.Essentials.Content.Routing.stores; namespace VNLib.Plugins.Essentials.Content.Routing { - [ConfigurationName("store")] + [ConfigurationName("store", Required = false)] internal sealed class ManagedRouteStore : IRouteStore { - private readonly IRouteStore _routeStore; + private readonly IRouteStore _routeStore = new DummyRouteStore(); + + //empty constructor for + public ManagedRouteStore(PluginBase plugin) + { + plugin.Log.Warn("Page router loaded but no route store was loaded. Routing funtionality is disabled."); + } public ManagedRouteStore(PluginBase plugin, IConfigScope config) { @@ -60,5 +67,11 @@ namespace VNLib.Plugins.Essentials.Content.Routing { return _routeStore.GetAllRoutesAsync(routes, cancellation); } + + private sealed class DummyRouteStore : IRouteStore + { + public Task GetAllRoutesAsync(ICollection<Route> routes, CancellationToken cancellation) + => Task.CompletedTask; + } } } |