diff --git a/src/VirtoCommerce.CoreModule.Data/Services/SequenceNumberGeneratorService.cs b/src/VirtoCommerce.CoreModule.Data/Services/SequenceNumberGeneratorService.cs index 48a6a62f..9fec7208 100644 --- a/src/VirtoCommerce.CoreModule.Data/Services/SequenceNumberGeneratorService.cs +++ b/src/VirtoCommerce.CoreModule.Data/Services/SequenceNumberGeneratorService.cs @@ -179,14 +179,12 @@ protected virtual int RequestNextCounter(string tenantId, CounterOptions counter protected virtual string GetSequenceKey(string tenantId, CounterOptions counterOptions) { - if(_options.UseGlobalTenantId) + if(_options.UseGlobalTenantId || string.IsNullOrEmpty(tenantId)) { - tenantId = "__GlobalTenant"; + return counterOptions.NumberTemplate; } - return string.IsNullOrEmpty(tenantId) ? - counterOptions.NumberTemplate : - $"{tenantId}/{counterOptions.NumberTemplate}"; + return $"{tenantId}/{counterOptions.NumberTemplate}"; } ///