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.
37 lines
968 B
37 lines
968 B
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
using Volo.Abp.Settings;
|
|
|
|
namespace Volo.Abp.IdentityServer.AspNetIdentity;
|
|
|
|
public class IdentityServerTestSettingValueProvider : ISettingValueProvider
|
|
{
|
|
public const string ProviderName = "IdentityServerDomainTest";
|
|
|
|
private readonly Dictionary<string, string> _values = new();
|
|
|
|
public string Name => ProviderName;
|
|
|
|
public void Set(string name, string value)
|
|
{
|
|
_values[name] = value;
|
|
}
|
|
|
|
public void Clear()
|
|
{
|
|
_values.Clear();
|
|
}
|
|
|
|
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(setting => new SettingValue(setting.Name, _values.GetOrDefault(setting.Name)))
|
|
.ToList());
|
|
}
|
|
}
|
|
|