Browse Source
Updated to use `IRemoteServiceConfigurationProvider `
pull/22355/head
enisn
11 months ago
No known key found for this signature in database
GPG Key ID: A052619F04155D1C
2 changed files with
6 additions and
6 deletions
-
docs/en/framework/api-development/dynamic-csharp-clients.md
-
docs/en/framework/api-development/static-csharp-clients.md
|
|
|
@ -171,16 +171,16 @@ You may need to get the remote service configuration for a specific remote servi |
|
|
|
````csharp |
|
|
|
public class MyService : ITransientDependency |
|
|
|
{ |
|
|
|
private readonly RemoteServiceConfigurationProvider _remoteServiceConfigurationProvider; |
|
|
|
private readonly IRemoteServiceConfigurationProvider _remoteServiceConfigurationProvider; |
|
|
|
|
|
|
|
public MyService(RemoteServiceConfigurationProvider remoteServiceConfigurationProvider) |
|
|
|
public MyService(IRemoteServiceConfigurationProvider remoteServiceConfigurationProvider) |
|
|
|
{ |
|
|
|
_remoteServiceConfigurationProvider = remoteServiceConfigurationProvider; |
|
|
|
} |
|
|
|
|
|
|
|
public async Task GetRemoteServiceConfiguration() |
|
|
|
{ |
|
|
|
var configuration = await _remoteServiceConfigurationProvider.GetConfigurationAsync("BookStore"); |
|
|
|
var configuration = await _remoteServiceConfigurationProvider.GetConfigurationOrDefaultAsync("BookStore"); |
|
|
|
Console.WriteLine(configuration.BaseUrl); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -252,16 +252,16 @@ You may need to get the remote service configuration for a specific remote servi |
|
|
|
````csharp |
|
|
|
public class MyService : ITransientDependency |
|
|
|
{ |
|
|
|
private readonly RemoteServiceConfigurationProvider _remoteServiceConfigurationProvider; |
|
|
|
private readonly IRemoteServiceConfigurationProvider _remoteServiceConfigurationProvider; |
|
|
|
|
|
|
|
public MyService(RemoteServiceConfigurationProvider remoteServiceConfigurationProvider) |
|
|
|
public MyService(IRemoteServiceConfigurationProvider remoteServiceConfigurationProvider) |
|
|
|
{ |
|
|
|
_remoteServiceConfigurationProvider = remoteServiceConfigurationProvider; |
|
|
|
} |
|
|
|
|
|
|
|
public async Task GetRemoteServiceConfiguration() |
|
|
|
{ |
|
|
|
var configuration = await _remoteServiceConfigurationProvider.GetConfigurationAsync("BookStore"); |
|
|
|
var configuration = await _remoteServiceConfigurationProvider.GetConfigurationOrDefaultAsync("BookStore"); |
|
|
|
Console.WriteLine(configuration.BaseUrl); |
|
|
|
} |
|
|
|
} |
|
|
|
|