From e86fa273f2093089bec6379b6fa6b48625588a40 Mon Sep 17 00:00:00 2001 From: vnugent Date: Tue, 2 Jan 2024 02:33:18 -0500 Subject: breaking changes: plugin service pools & move plugin api away from web related --- .../src/PageRouterEntry.cs | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'plugins/VNLib.Plugins.Essentials.Content.Routing/src/PageRouterEntry.cs') diff --git a/plugins/VNLib.Plugins.Essentials.Content.Routing/src/PageRouterEntry.cs b/plugins/VNLib.Plugins.Essentials.Content.Routing/src/PageRouterEntry.cs index 8370806..da254e2 100644 --- a/plugins/VNLib.Plugins.Essentials.Content.Routing/src/PageRouterEntry.cs +++ b/plugins/VNLib.Plugins.Essentials.Content.Routing/src/PageRouterEntry.cs @@ -1,5 +1,5 @@ /* -* Copyright (c) 2023 Vaughn Nugent +* Copyright (c) 2024 Vaughn Nugent * * Library: VNLib * Package: VNLib.Plugins.Essentials.Content.Routing @@ -23,10 +23,8 @@ */ using System; -using System.ComponentModel.Design; using VNLib.Utils.Logging; -using VNLib.Plugins.Attributes; using VNLib.Plugins.Extensions.Loading; namespace VNLib.Plugins.Essentials.Content.Routing @@ -35,19 +33,13 @@ namespace VNLib.Plugins.Essentials.Content.Routing { public override string PluginName => "Essentials.Router"; - private Router PageRouter; - - [ServiceConfigurator] - public void ConfigureServices(IServiceContainer services) - { - //Deploy the page router to the host - services.AddService(PageRouter); - } + private Router Router; protected override void OnLoad() { - //Init router - PageRouter = this.GetOrCreateSingleton(); + //Init router and export it as a service + Router = this.GetOrCreateSingleton(); + this.ExportService(Router); Log.Information("Plugin loaded"); } @@ -61,7 +53,7 @@ namespace VNLib.Plugins.Essentials.Content.Routing { if(cmd.Contains("reset", StringComparison.OrdinalIgnoreCase)) { - PageRouter?.ResetRoutes(); + Router?.ResetRoutes(); Log.Information("Routing table reset"); } } -- cgit