mirror of https://github.com/abpframework/abp.git
39 changed files with 471 additions and 236 deletions
@ -1,21 +1,13 @@ |
|||||
using Volo.Abp.Data; |
using Volo.Abp.Data; |
||||
using Volo.Abp.Modularity; |
using Volo.Abp.Modularity; |
||||
using Volo.Abp.Settings; |
|
||||
|
|
||||
namespace Volo.Abp.MultiTenancy |
namespace Volo.Abp.MultiTenancy |
||||
{ |
{ |
||||
[DependsOn( |
[DependsOn( |
||||
typeof(AbpDataModule), |
typeof(AbpDataModule) |
||||
typeof(AbpSettingsModule) |
|
||||
)] |
)] |
||||
public class AbpMultiTenancyAbstractionsModule : AbpModule //TODO: Rename to AbpMultiTenancyModule?
|
public class AbpMultiTenancyAbstractionsModule : AbpModule //TODO: Rename to AbpMultiTenancyModule?
|
||||
{ |
{ |
||||
public override void ConfigureServices(ServiceConfigurationContext context) |
|
||||
{ |
|
||||
Configure<SettingOptions>(options => |
|
||||
{ |
|
||||
options.ValueProviders.Add<TenantSettingValueProvider>(); |
|
||||
}); |
|
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,45 +0,0 @@ |
|||||
using System.Threading.Tasks; |
|
||||
using Volo.Abp.Settings; |
|
||||
|
|
||||
namespace Volo.Abp.MultiTenancy |
|
||||
{ |
|
||||
public class TenantSettingValueProvider : SettingValueProvider |
|
||||
{ |
|
||||
public const string ProviderName = "Tenant"; |
|
||||
|
|
||||
public override string Name => ProviderName; |
|
||||
|
|
||||
protected ICurrentTenant CurrentTenant { get; } |
|
||||
|
|
||||
public TenantSettingValueProvider(ISettingStore settingStore, ICurrentTenant currentTenant) |
|
||||
: base(settingStore) |
|
||||
{ |
|
||||
CurrentTenant = currentTenant; |
|
||||
} |
|
||||
|
|
||||
public override async Task<string> GetOrNullAsync(SettingDefinition setting, string providerKey) |
|
||||
{ |
|
||||
return await SettingStore.GetOrNullAsync(setting.Name, Name, NormalizeProviderKey(providerKey)); |
|
||||
} |
|
||||
|
|
||||
public override Task SetAsync(SettingDefinition setting, string value, string providerKey) |
|
||||
{ |
|
||||
return SettingStore.SetAsync(setting.Name, value, Name, NormalizeProviderKey(providerKey)); |
|
||||
} |
|
||||
|
|
||||
public override Task ClearAsync(SettingDefinition setting, string providerKey) |
|
||||
{ |
|
||||
return SettingStore.DeleteAsync(setting.Name, Name, NormalizeProviderKey(providerKey)); |
|
||||
} |
|
||||
|
|
||||
private string NormalizeProviderKey(string providerKey) |
|
||||
{ |
|
||||
if (providerKey == null && CurrentTenant.Id.HasValue) |
|
||||
{ |
|
||||
return CurrentTenant.Id.Value.ToString(); |
|
||||
} |
|
||||
|
|
||||
return providerKey; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,15 +1,27 @@ |
|||||
using Volo.Abp.Localization; |
using Volo.Abp.Localization; |
||||
using Volo.Abp.Modularity; |
using Volo.Abp.Modularity; |
||||
|
using Volo.Abp.MultiTenancy; |
||||
using Volo.Abp.Security; |
using Volo.Abp.Security; |
||||
|
using Volo.Abp.Users; |
||||
|
|
||||
namespace Volo.Abp.Settings |
namespace Volo.Abp.Settings |
||||
{ |
{ |
||||
[DependsOn( |
[DependsOn( |
||||
typeof(AbpLocalizationAbstractionsModule), |
typeof(AbpLocalizationAbstractionsModule), |
||||
typeof(AbpSecurityModule) |
typeof(AbpSecurityModule), |
||||
|
typeof(AbpMultiTenancyAbstractionsModule) |
||||
)] |
)] |
||||
public class AbpSettingsModule : AbpModule |
public class AbpSettingsModule : AbpModule |
||||
{ |
{ |
||||
|
public override void ConfigureServices(ServiceConfigurationContext context) |
||||
|
{ |
||||
|
Configure<SettingOptions>(options => |
||||
|
{ |
||||
|
options.ValueProviders.Add<DefaultValueSettingValueProvider>(); |
||||
|
options.ValueProviders.Add<GlobalSettingValueProvider>(); |
||||
|
options.ValueProviders.Add<TenantSettingValueProvider>(); |
||||
|
options.ValueProviders.Add<UserSettingValueProvider>(); |
||||
|
}); |
||||
|
} |
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,17 +1,14 @@ |
|||||
using System.Collections.Generic; |
using System.Threading.Tasks; |
||||
using System.Threading.Tasks; |
|
||||
using JetBrains.Annotations; |
using JetBrains.Annotations; |
||||
|
|
||||
namespace Volo.Abp.Settings |
namespace Volo.Abp.Settings |
||||
{ |
{ |
||||
public interface ISettingStore |
public interface ISettingStore |
||||
{ |
{ |
||||
Task<string> GetOrNullAsync([NotNull] string name, [CanBeNull] string providerName, [CanBeNull] string providerKey); |
Task<string> GetOrNullAsync( |
||||
|
[NotNull] string name, |
||||
Task SetAsync([NotNull] string name, [NotNull] string value, [CanBeNull] string providerName, [CanBeNull] string providerKey); |
[CanBeNull] string providerName, |
||||
|
[CanBeNull] string providerKey |
||||
Task<List<SettingValue>> GetListAsync([CanBeNull] string providerName, [CanBeNull] string providerKey); |
); |
||||
|
|
||||
Task DeleteAsync([NotNull] string name, [CanBeNull]string providerName, [CanBeNull]string providerKey); |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -0,0 +1,25 @@ |
|||||
|
using System.Threading.Tasks; |
||||
|
using Volo.Abp.MultiTenancy; |
||||
|
|
||||
|
namespace Volo.Abp.Settings |
||||
|
{ |
||||
|
public class TenantSettingValueProvider : SettingValueProvider |
||||
|
{ |
||||
|
public const string ProviderName = "Tenant"; |
||||
|
|
||||
|
public override string Name => ProviderName; |
||||
|
|
||||
|
protected ICurrentTenant CurrentTenant { get; } |
||||
|
|
||||
|
public TenantSettingValueProvider(ISettingStore settingStore, ICurrentTenant currentTenant) |
||||
|
: base(settingStore) |
||||
|
{ |
||||
|
CurrentTenant = currentTenant; |
||||
|
} |
||||
|
|
||||
|
public override async Task<string> GetOrNullAsync(SettingDefinition setting) |
||||
|
{ |
||||
|
return await SettingStore.GetOrNullAsync(setting.Name, Name, CurrentTenant.Id?.ToString()); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,30 @@ |
|||||
|
using System.Threading.Tasks; |
||||
|
using Volo.Abp.Users; |
||||
|
|
||||
|
namespace Volo.Abp.Settings |
||||
|
{ |
||||
|
public class UserSettingValueProvider : SettingValueProvider |
||||
|
{ |
||||
|
public const string ProviderName = "User"; |
||||
|
|
||||
|
public override string Name => ProviderName; |
||||
|
|
||||
|
protected ICurrentUser CurrentUser { get; } |
||||
|
|
||||
|
public UserSettingValueProvider(ISettingStore settingStore, ICurrentUser currentUser) |
||||
|
: base(settingStore) |
||||
|
{ |
||||
|
CurrentUser = currentUser; |
||||
|
} |
||||
|
|
||||
|
public override async Task<string> GetOrNullAsync(SettingDefinition setting) |
||||
|
{ |
||||
|
if (CurrentUser.Id == null) |
||||
|
{ |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
return await SettingStore.GetOrNullAsync(setting.Name, Name, CurrentUser.Id.ToString()); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,26 @@ |
|||||
|
using System.Threading.Tasks; |
||||
|
using Volo.Abp.DependencyInjection; |
||||
|
using Volo.Abp.Settings; |
||||
|
|
||||
|
namespace Volo.Abp.SettingManagement |
||||
|
{ |
||||
|
public class DefaultValueSettingManagementProvider : ISettingManagementProvider, ISingletonDependency |
||||
|
{ |
||||
|
public string Name => DefaultValueSettingValueProvider.ProviderName; |
||||
|
|
||||
|
public Task<string> GetOrNullAsync(SettingDefinition setting, string providerKey) |
||||
|
{ |
||||
|
return Task.FromResult(setting.DefaultValue); |
||||
|
} |
||||
|
|
||||
|
public Task SetAsync(SettingDefinition setting, string value, string providerKey) |
||||
|
{ |
||||
|
throw new AbpException($"Can not set default value of a setting. It is only possible while defining the setting in a {typeof(ISettingDefinitionProvider)} implementation."); |
||||
|
} |
||||
|
|
||||
|
public Task ClearAsync(SettingDefinition setting, string providerKey) |
||||
|
{ |
||||
|
throw new AbpException($"Can not clear default value of a setting. It is only possible while defining the setting in a {typeof(ISettingDefinitionProvider)} implementation."); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,20 @@ |
|||||
|
using System.Collections.Generic; |
||||
|
using System.Threading.Tasks; |
||||
|
using JetBrains.Annotations; |
||||
|
using Volo.Abp.Settings; |
||||
|
|
||||
|
namespace Volo.Abp.SettingManagement |
||||
|
{ |
||||
|
public static class DefaultValueSettingManagerExtensions |
||||
|
{ |
||||
|
public static Task<string> GetOrNullDefaultAsync(this ISettingManager settingManager, [NotNull] string name, bool fallback = true) |
||||
|
{ |
||||
|
return settingManager.GetOrNullAsync(name, DefaultValueSettingValueProvider.ProviderName, null, fallback); |
||||
|
} |
||||
|
|
||||
|
public static Task<List<SettingValue>> GetAllDefaultAsync(this ISettingManager settingManager, bool fallback = true) |
||||
|
{ |
||||
|
return settingManager.GetAllAsync(DefaultValueSettingValueProvider.ProviderName, null, fallback); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,21 @@ |
|||||
|
using Volo.Abp.DependencyInjection; |
||||
|
using Volo.Abp.Settings; |
||||
|
|
||||
|
namespace Volo.Abp.SettingManagement |
||||
|
{ |
||||
|
public class GlobalSettingManagementProvider : SettingManagementProvider, ITransientDependency |
||||
|
{ |
||||
|
public override string Name => GlobalSettingValueProvider.ProviderName; |
||||
|
|
||||
|
public GlobalSettingManagementProvider(ISettingManagementStore settingManagementStore) |
||||
|
: base(settingManagementStore) |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
protected override string NormalizeProviderKey(string providerKey) |
||||
|
{ |
||||
|
return null; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -1,8 +1,9 @@ |
|||||
using System.Collections.Generic; |
using System.Collections.Generic; |
||||
using System.Threading.Tasks; |
using System.Threading.Tasks; |
||||
using JetBrains.Annotations; |
using JetBrains.Annotations; |
||||
|
using Volo.Abp.Settings; |
||||
|
|
||||
namespace Volo.Abp.Settings |
namespace Volo.Abp.SettingManagement |
||||
{ |
{ |
||||
public static class GlobalSettingManagerExtensions |
public static class GlobalSettingManagerExtensions |
||||
{ |
{ |
||||
@ -0,0 +1,17 @@ |
|||||
|
using System.Threading.Tasks; |
||||
|
using JetBrains.Annotations; |
||||
|
using Volo.Abp.Settings; |
||||
|
|
||||
|
namespace Volo.Abp.SettingManagement |
||||
|
{ |
||||
|
public interface ISettingManagementProvider |
||||
|
{ |
||||
|
string Name { get; } |
||||
|
|
||||
|
Task<string> GetOrNullAsync([NotNull] SettingDefinition setting, [CanBeNull] string providerKey); |
||||
|
|
||||
|
Task SetAsync([NotNull] SettingDefinition setting, [NotNull] string value, [CanBeNull] string providerKey); |
||||
|
|
||||
|
Task ClearAsync([NotNull] SettingDefinition setting, [CanBeNull] string providerKey); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,17 @@ |
|||||
|
using System.Collections.Generic; |
||||
|
using System.Threading.Tasks; |
||||
|
using Volo.Abp.Settings; |
||||
|
|
||||
|
namespace Volo.Abp.SettingManagement |
||||
|
{ |
||||
|
public interface ISettingManagementStore |
||||
|
{ |
||||
|
Task<string> GetOrNullAsync(string name, string providerName, string providerKey); |
||||
|
|
||||
|
Task<List<SettingValue>> GetListAsync(string providerName, string providerKey); |
||||
|
|
||||
|
Task SetAsync(string name, string value, string providerName, string providerKey); |
||||
|
|
||||
|
Task DeleteAsync(string name, string providerName, string providerKey); |
||||
|
} |
||||
|
} |
||||
@ -1,8 +1,9 @@ |
|||||
using System.Collections.Generic; |
using System.Collections.Generic; |
||||
using System.Threading.Tasks; |
using System.Threading.Tasks; |
||||
using JetBrains.Annotations; |
using JetBrains.Annotations; |
||||
|
using Volo.Abp.Settings; |
||||
|
|
||||
namespace Volo.Abp.Settings |
namespace Volo.Abp.SettingManagement |
||||
{ |
{ |
||||
public interface ISettingManager |
public interface ISettingManager |
||||
{ |
{ |
||||
@ -0,0 +1,14 @@ |
|||||
|
using Volo.Abp.Collections; |
||||
|
|
||||
|
namespace Volo.Abp.SettingManagement |
||||
|
{ |
||||
|
public class SettingManagementOptions |
||||
|
{ |
||||
|
public ITypeList<ISettingManagementProvider> Providers { get; } |
||||
|
|
||||
|
public SettingManagementOptions() |
||||
|
{ |
||||
|
Providers = new TypeList<ISettingManagementProvider>(); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,37 @@ |
|||||
|
using System.Threading.Tasks; |
||||
|
using Volo.Abp.Settings; |
||||
|
|
||||
|
namespace Volo.Abp.SettingManagement |
||||
|
{ |
||||
|
public abstract class SettingManagementProvider : ISettingManagementProvider |
||||
|
{ |
||||
|
public abstract string Name { get; } |
||||
|
|
||||
|
protected ISettingManagementStore SettingManagementStore { get; } |
||||
|
|
||||
|
protected SettingManagementProvider(ISettingManagementStore settingManagementStore) |
||||
|
{ |
||||
|
SettingManagementStore = settingManagementStore; |
||||
|
} |
||||
|
|
||||
|
public async Task<string> GetOrNullAsync(SettingDefinition setting, string providerKey) |
||||
|
{ |
||||
|
return await SettingManagementStore.GetOrNullAsync(setting.Name, Name, NormalizeProviderKey(providerKey)); |
||||
|
} |
||||
|
|
||||
|
public virtual async Task SetAsync(SettingDefinition setting, string value, string providerKey) |
||||
|
{ |
||||
|
await SettingManagementStore.SetAsync(setting.Name, value, Name, NormalizeProviderKey(providerKey)); |
||||
|
} |
||||
|
|
||||
|
public virtual async Task ClearAsync(SettingDefinition setting, string providerKey) |
||||
|
{ |
||||
|
await SettingManagementStore.DeleteAsync(setting.Name, Name, NormalizeProviderKey(providerKey)); |
||||
|
} |
||||
|
|
||||
|
protected virtual string NormalizeProviderKey(string providerKey) |
||||
|
{ |
||||
|
return providerKey; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,90 @@ |
|||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Threading.Tasks; |
||||
|
using Volo.Abp.Caching; |
||||
|
using Volo.Abp.DependencyInjection; |
||||
|
using Volo.Abp.Guids; |
||||
|
using Volo.Abp.Settings; |
||||
|
|
||||
|
namespace Volo.Abp.SettingManagement |
||||
|
{ |
||||
|
public class SettingManagementStore : ISettingManagementStore, ITransientDependency |
||||
|
{ |
||||
|
protected IDistributedCache<SettingCacheItem> Cache { get; } |
||||
|
protected ISettingRepository SettingRepository { get; } |
||||
|
protected IGuidGenerator GuidGenerator { get; } |
||||
|
|
||||
|
public SettingManagementStore( |
||||
|
ISettingRepository settingRepository, |
||||
|
IGuidGenerator guidGenerator, |
||||
|
IDistributedCache<SettingCacheItem> cache) |
||||
|
{ |
||||
|
SettingRepository = settingRepository; |
||||
|
GuidGenerator = guidGenerator; |
||||
|
Cache = cache; |
||||
|
} |
||||
|
|
||||
|
public async Task<string> GetOrNullAsync(string name, string providerName, string providerKey) |
||||
|
{ |
||||
|
var cacheItem = await GetCacheItemAsync(name, providerName, providerKey); |
||||
|
return cacheItem.Value; |
||||
|
} |
||||
|
|
||||
|
public async Task SetAsync(string name, string value, string providerName, string providerKey) |
||||
|
{ |
||||
|
var setting = await SettingRepository.FindAsync(name, providerName, providerKey); |
||||
|
if (setting == null) |
||||
|
{ |
||||
|
setting = new Setting(GuidGenerator.Create(), name, value, providerName, providerKey); |
||||
|
await SettingRepository.InsertAsync(setting); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
setting.Value = value; |
||||
|
await SettingRepository.UpdateAsync(setting); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
public async Task<List<SettingValue>> GetListAsync(string providerName, string providerKey) |
||||
|
{ |
||||
|
var settings = await SettingRepository.GetListAsync(providerName, providerKey); |
||||
|
return settings.Select(s => new SettingValue(s.Name, s.Value)).ToList(); |
||||
|
} |
||||
|
|
||||
|
public async Task DeleteAsync(string name, string providerName, string providerKey) |
||||
|
{ |
||||
|
var setting = await SettingRepository.FindAsync(name, providerName, providerKey); |
||||
|
if (setting != null) |
||||
|
{ |
||||
|
await SettingRepository.DeleteAsync(setting); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
protected virtual async Task<SettingCacheItem> GetCacheItemAsync(string name, string providerName, string providerKey) |
||||
|
{ |
||||
|
var cacheKey = CalculateCacheKey(name, providerName, providerKey); |
||||
|
var cacheItem = await Cache.GetAsync(cacheKey); |
||||
|
|
||||
|
if (cacheItem != null) |
||||
|
{ |
||||
|
return cacheItem; |
||||
|
} |
||||
|
|
||||
|
var setting = await SettingRepository.FindAsync(name, providerName, providerKey); |
||||
|
|
||||
|
cacheItem = new SettingCacheItem(setting?.Value); |
||||
|
|
||||
|
await Cache.SetAsync( |
||||
|
cacheKey, |
||||
|
cacheItem |
||||
|
); |
||||
|
|
||||
|
return cacheItem; |
||||
|
} |
||||
|
|
||||
|
protected virtual string CalculateCacheKey(string name, string providerName, string providerKey) |
||||
|
{ |
||||
|
return SettingCacheItem.CalculateCacheKey(name, providerName, providerKey); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,31 @@ |
|||||
|
using Volo.Abp.DependencyInjection; |
||||
|
using Volo.Abp.MultiTenancy; |
||||
|
using Volo.Abp.Settings; |
||||
|
|
||||
|
namespace Volo.Abp.SettingManagement |
||||
|
{ |
||||
|
public class TenantSettingManagementProvider : SettingManagementProvider, ITransientDependency |
||||
|
{ |
||||
|
public override string Name => TenantSettingValueProvider.ProviderName; |
||||
|
|
||||
|
protected ICurrentTenant CurrentTenant { get; } |
||||
|
|
||||
|
public TenantSettingManagementProvider( |
||||
|
ISettingManagementStore settingManagementStore, |
||||
|
ICurrentTenant currentTenant) |
||||
|
: base(settingManagementStore) |
||||
|
{ |
||||
|
CurrentTenant = currentTenant; |
||||
|
} |
||||
|
|
||||
|
protected override string NormalizeProviderKey(string providerKey) |
||||
|
{ |
||||
|
if (providerKey != null) |
||||
|
{ |
||||
|
return providerKey; |
||||
|
} |
||||
|
|
||||
|
return CurrentTenant.Id?.ToString(); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,31 @@ |
|||||
|
using Volo.Abp.DependencyInjection; |
||||
|
using Volo.Abp.Settings; |
||||
|
using Volo.Abp.Users; |
||||
|
|
||||
|
namespace Volo.Abp.SettingManagement |
||||
|
{ |
||||
|
public class UserSettingManagementProvider : SettingManagementProvider, ITransientDependency |
||||
|
{ |
||||
|
public override string Name => UserSettingValueProvider.ProviderName; |
||||
|
|
||||
|
protected ICurrentUser CurrentUser { get; } |
||||
|
|
||||
|
public UserSettingManagementProvider( |
||||
|
ISettingManagementStore settingManagementStore, |
||||
|
ICurrentUser currentUser) |
||||
|
: base(settingManagementStore) |
||||
|
{ |
||||
|
CurrentUser = currentUser; |
||||
|
} |
||||
|
|
||||
|
protected override string NormalizeProviderKey(string providerKey) |
||||
|
{ |
||||
|
if (providerKey != null) |
||||
|
{ |
||||
|
return providerKey; |
||||
|
} |
||||
|
|
||||
|
return CurrentUser.Id?.ToString(); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -1,48 +0,0 @@ |
|||||
using System.Threading.Tasks; |
|
||||
using Volo.Abp.Settings; |
|
||||
|
|
||||
namespace Volo.Abp.Users |
|
||||
{ |
|
||||
//TODO: Optimization: Get all settings and cache it!
|
|
||||
//TODO: Think if it's true to have this provider in this project?
|
|
||||
|
|
||||
public class UserSettingValueProvider : SettingValueProvider |
|
||||
{ |
|
||||
public const string ProviderName = "User"; |
|
||||
|
|
||||
public override string Name => ProviderName; |
|
||||
|
|
||||
protected ICurrentUser CurrentUser { get; } |
|
||||
|
|
||||
public UserSettingValueProvider(ISettingStore settingStore, ICurrentUser currentUser) |
|
||||
: base(settingStore) |
|
||||
{ |
|
||||
CurrentUser = currentUser; |
|
||||
} |
|
||||
|
|
||||
public override async Task<string> GetOrNullAsync(SettingDefinition setting, string providerKey) |
|
||||
{ |
|
||||
return await SettingStore.GetOrNullAsync(setting.Name, Name, NormalizeProviderKey(providerKey)); |
|
||||
} |
|
||||
|
|
||||
public override Task SetAsync(SettingDefinition setting, string value, string providerKey) |
|
||||
{ |
|
||||
return SettingStore.SetAsync(setting.Name, value, Name, NormalizeProviderKey(providerKey)); |
|
||||
} |
|
||||
|
|
||||
public override Task ClearAsync(SettingDefinition setting, string providerKey) |
|
||||
{ |
|
||||
return SettingStore.DeleteAsync(setting.Name, Name, NormalizeProviderKey(providerKey)); |
|
||||
} |
|
||||
|
|
||||
private string NormalizeProviderKey(string providerKey) |
|
||||
{ |
|
||||
if (providerKey == null && CurrentUser.Id.HasValue) |
|
||||
{ |
|
||||
return CurrentUser.Id.Value.ToString(); |
|
||||
} |
|
||||
|
|
||||
return providerKey; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
Loading…
Reference in new issue