From 85ac8dd7010b23099de1f7cbeeedbf11b2043003 Mon Sep 17 00:00:00 2001 From: Mark Davis <311063+markdav-is@users.noreply.github.com> Date: Sat, 4 Feb 2023 09:04:54 -0800 Subject: [PATCH] Make ActiveDatabase setter public We have two cases where we need to override the active database: Unit Testing and added GraphQL. In both of these cases, we have a database context that is in a different scope than the automatically assigned active database during normal Oqtane startup. Our work-around has been to make this setter public. Unless there is a better solution to our cases, I feel this change would be useful for others as well. --- Oqtane.Server/Repository/Context/DBContextBase.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Oqtane.Server/Repository/Context/DBContextBase.cs b/Oqtane.Server/Repository/Context/DBContextBase.cs index 926bdcf2..6d876d47 100644 --- a/Oqtane.Server/Repository/Context/DBContextBase.cs +++ b/Oqtane.Server/Repository/Context/DBContextBase.cs @@ -31,7 +31,7 @@ namespace Oqtane.Repository _accessor = httpContextAccessor; } - public IDatabase ActiveDatabase { get; private set; } + public IDatabase ActiveDatabase { get; set; } protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) {