diff options
author | vnugent <public@vaughnnugent.com> | 2023-11-29 00:20:52 -0500 |
---|---|---|
committer | vnugent <public@vaughnnugent.com> | 2023-11-29 00:20:52 -0500 |
commit | 58feb2c98fc2bb05998a078a2b357578d11eecb9 (patch) | |
tree | acf0ac8f92d97ffa661dee5e75bf1b8bb4f67278 /plugins/VNLib.Plugins.Essentials.Content.Routing/src | |
parent | 381638ef7b6995980b4b140c9acd015ed818c0f5 (diff) |
more async db loading, whitelist middleware,
Diffstat (limited to 'plugins/VNLib.Plugins.Essentials.Content.Routing/src')
-rw-r--r-- | plugins/VNLib.Plugins.Essentials.Content.Routing/src/Model/DbRouteStore.cs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/plugins/VNLib.Plugins.Essentials.Content.Routing/src/Model/DbRouteStore.cs b/plugins/VNLib.Plugins.Essentials.Content.Routing/src/Model/DbRouteStore.cs index b90ee65..b7f64e2 100644 --- a/plugins/VNLib.Plugins.Essentials.Content.Routing/src/Model/DbRouteStore.cs +++ b/plugins/VNLib.Plugins.Essentials.Content.Routing/src/Model/DbRouteStore.cs @@ -31,6 +31,7 @@ using System.Threading.Tasks; using Microsoft.EntityFrameworkCore; using VNLib.Plugins.Extensions.Data; +using VNLib.Plugins.Extensions.Loading; using VNLib.Plugins.Extensions.Loading.Sql; using VNLib.Plugins.Extensions.Data.Abstractions; using VNLib.Plugins.Extensions.Data.Extensions; @@ -39,14 +40,14 @@ namespace VNLib.Plugins.Essentials.Content.Routing.Model { internal sealed class DbRouteStore : DbStore<Route>, IRouteStore { - private readonly DbContextOptions Options; + private readonly IAsyncLazy<DbContextOptions> Options; public override IDbQueryLookup<Route> QueryTable { get; } = new DbQueries(); public DbRouteStore(PluginBase plugin) { //Load the db context options - Options = plugin.GetContextOptions(); + Options = plugin.GetContextOptionsAsync(); } ///<inheritdoc/> @@ -60,7 +61,7 @@ namespace VNLib.Plugins.Essentials.Content.Routing.Model public override string GetNewRecordId() => Guid.NewGuid().ToString("N"); ///<inheritdoc/> - public override IDbContextHandle GetNewContext() => new RoutingContext(Options); + public override IDbContextHandle GetNewContext() => new RoutingContext(Options.Value); ///<inheritdoc/> public override void OnRecordUpdate(Route newRecord, Route currentRecord) |