Open Source Web Application Framework for ASP.NET Core
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.
 
 
 
 
 
 

29 lines
866 B

using System.Collections.Generic;
using JetBrains.Annotations;
namespace Volo.Abp.Http.Client;
public class RemoteServiceConfigurationDictionary : Dictionary<string, RemoteServiceConfiguration>
{
public const string DefaultName = "Default";
public RemoteServiceConfiguration Default {
get => this.GetOrDefault(DefaultName);
set => this[DefaultName] = value;
}
[NotNull]
public RemoteServiceConfiguration GetConfigurationOrDefault(string name)
{
return this.GetOrDefault(name)
?? Default
?? throw new AbpException($"Remote service '{name}' was not found and there is no default configuration.");
}
[CanBeNull]
public RemoteServiceConfiguration GetConfigurationOrDefaultOrNull(string name)
{
return this.GetOrDefault(name)
?? Default;
}
}