mirror of https://github.com/abpframework/abp.git
csharpabpc-sharpframeworkblazoraspnet-coredotnet-coreaspnetcorearchitecturesaasdomain-driven-designangularmulti-tenancy
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
886 B
31 lines
886 B
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
using Volo.Abp.DependencyInjection;
|
|
using Volo.Abp.Settings;
|
|
|
|
namespace Volo.Abp.Identity;
|
|
|
|
public class TestSettingValueProvider : ISettingValueProvider, ITransientDependency
|
|
{
|
|
public const string ProviderName = "Test";
|
|
|
|
private readonly static Dictionary<string, string> Values = new ();
|
|
|
|
public string Name => ProviderName;
|
|
|
|
public static void AddSetting(string name, string value)
|
|
{
|
|
Values[name] = value;
|
|
}
|
|
|
|
public Task<string> GetOrNullAsync(SettingDefinition setting)
|
|
{
|
|
return Task.FromResult(Values.GetOrDefault(setting.Name));
|
|
}
|
|
|
|
public Task<List<SettingValue>> GetAllAsync(SettingDefinition[] settings)
|
|
{
|
|
return Task.FromResult(settings.Select(x => new SettingValue(x.Name, Values.GetOrDefault(x.Name))).ToList());
|
|
}
|
|
}
|
|
|