mirror of https://github.com/abpframework/abp.git
11 changed files with 57 additions and 47 deletions
@ -1,21 +0,0 @@ |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace Volo.Abp.Settings |
|||
{ |
|||
public class CurrentTenantSettingContributor : ISettingContributor |
|||
{ |
|||
private readonly ISettingStore _settingStore; |
|||
|
|||
public CurrentTenantSettingContributor(ISettingStore settingStore) |
|||
{ |
|||
_settingStore = settingStore; |
|||
} |
|||
|
|||
public async Task<string> GetOrNull(string name) |
|||
{ |
|||
//Optimization: Get all Tenant-42 settings and cache it!
|
|||
var tenantId = 42; //Get from current tenant
|
|||
return await _settingStore.GetOrNullAsync(name, "Tenant", tenantId.ToString()); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,17 @@ |
|||
using Volo.Abp.Collections; |
|||
|
|||
namespace Volo.Abp.Settings |
|||
{ |
|||
public class SettingOptions |
|||
{ |
|||
public ITypeList<ISettingContributor> Contributors { get; } |
|||
|
|||
public SettingOptions() |
|||
{ |
|||
Contributors = new TypeList<ISettingContributor> |
|||
{ |
|||
typeof(DefaultSettingContributor) |
|||
}; |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue