From e2e89d67333890c36d0a5b2eb5c1db726d8bb760 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Sat, 6 Jan 2018 13:27:13 +0300 Subject: [PATCH] Added comments --- .../AbpDesk.ConsoleDemo/appsettings.json | 28 ++++++------------- .../Abp/MultiTenancy/TenantScopeProvider.cs | 6 ++++ 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/src/AbpDesk/AbpDesk.ConsoleDemo/appsettings.json b/src/AbpDesk/AbpDesk.ConsoleDemo/appsettings.json index dad3aa4652..9f2ec0892b 100644 --- a/src/AbpDesk/AbpDesk.ConsoleDemo/appsettings.json +++ b/src/AbpDesk/AbpDesk.ConsoleDemo/appsettings.json @@ -8,30 +8,18 @@ { "Id": "2D8BF07D-50F4-4A70-805E-C7618F008043", "Name": "Acme", - "ConnectionStrings": [ - { - "Name": "Default", - "Value": "..." - }, - { - "Name": "AbpDeskMongoBlog", - "Value": "..." - } - ] + "ConnectionStrings": { + "Default": "...", + "AbpDeskMongoBlog": "..." + } }, { "Id": "33A01BA1-4106-41DA-AF34-28028FB9BD1D", "Name": "Vlsft", - "ConnectionStrings": [ - { - "Name": "Default", - "Value": "..." - }, - { - "Name": "AbpDeskMongoBlog", - "Value": "..." - } - ] + "ConnectionStrings": { + "Default": "...", + "AbpDeskMongoBlog": "..." + } } ] } \ No newline at end of file diff --git a/src/Volo.Abp.MultiTenancy.Abstractions/Volo/Abp/MultiTenancy/TenantScopeProvider.cs b/src/Volo.Abp.MultiTenancy.Abstractions/Volo/Abp/MultiTenancy/TenantScopeProvider.cs index 1140201357..8d3f768854 100644 --- a/src/Volo.Abp.MultiTenancy.Abstractions/Volo/Abp/MultiTenancy/TenantScopeProvider.cs +++ b/src/Volo.Abp.MultiTenancy.Abstractions/Volo/Abp/MultiTenancy/TenantScopeProvider.cs @@ -4,6 +4,12 @@ using Volo.Abp.DependencyInjection; namespace Volo.Abp.MultiTenancy { + /* This cass uses TenantScope instead of TenantInfo because being null of CurrentScope is different that being null of CurrentScope.Tenant. + * A null CurrentScope indicates that we haven't set any scope explicitly (and we can use tenant resolvers to determine the current tenant). + * A null CurrentScope.Tenant indicates that we have set null tenant value (maybe to switch to host) explicitly. + * A non-null CurrentScope.Tenant indicates that we have set a tenant value explicitly. + */ + public class TenantScopeProvider : ISingletonDependency { public TenantScope CurrentScope