mirror of https://github.com/abpframework/abp.git
7 changed files with 67 additions and 24 deletions
@ -0,0 +1,13 @@ |
|||
using JetBrains.Annotations; |
|||
|
|||
namespace Volo.Abp.Http.Client |
|||
{ |
|||
public interface IRemoteServiceConfigurationProvider |
|||
{ |
|||
[NotNull] |
|||
RemoteServiceConfiguration GetConfigurationOrDefault(string name); |
|||
|
|||
[CanBeNull] |
|||
RemoteServiceConfiguration GetConfigurationOrDefaultOrNull(string name); |
|||
} |
|||
} |
|||
@ -0,0 +1,25 @@ |
|||
using Microsoft.Extensions.Options; |
|||
using Volo.Abp.DependencyInjection; |
|||
|
|||
namespace Volo.Abp.Http.Client |
|||
{ |
|||
public class RemoteServiceConfigurationProvider : IRemoteServiceConfigurationProvider, IScopedDependency |
|||
{ |
|||
protected AbpRemoteServiceOptions Options { get; } |
|||
|
|||
public RemoteServiceConfigurationProvider(IOptionsSnapshot<AbpRemoteServiceOptions> options) |
|||
{ |
|||
Options = options.Value; |
|||
} |
|||
|
|||
public virtual RemoteServiceConfiguration GetConfigurationOrDefault(string name) |
|||
{ |
|||
return Options.RemoteServices.GetConfigurationOrDefault(name); |
|||
} |
|||
|
|||
public virtual RemoteServiceConfiguration GetConfigurationOrDefaultOrNull(string name) |
|||
{ |
|||
return Options.RemoteServices.GetConfigurationOrDefaultOrNull(name); |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue