From af93884a10f3dc01b8108ab6f665e48a81c8f040 Mon Sep 17 00:00:00 2001 From: "Jeremy D. Miller" Date: Tue, 21 May 2024 13:01:54 -0500 Subject: [PATCH] Correcting the tenant id on session creation --- src/Marten/Internal/Sessions/QuerySession.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Marten/Internal/Sessions/QuerySession.cs b/src/Marten/Internal/Sessions/QuerySession.cs index 9b5af3a976..de54190fa6 100644 --- a/src/Marten/Internal/Sessions/QuerySession.cs +++ b/src/Marten/Internal/Sessions/QuerySession.cs @@ -49,7 +49,7 @@ internal QuerySession( ) { _store = store; - TenantId = tenant?.TenantId ?? sessionOptions.Tenant?.TenantId ?? sessionOptions.TenantId; + TenantId = store.Options.MaybeCorrectTenantId(tenant?.TenantId ?? sessionOptions.Tenant?.TenantId ?? sessionOptions.TenantId); Database = tenant?.Database ?? sessionOptions.Tenant?.Database ?? throw new ArgumentNullException(nameof(SessionOptions.Tenant));