Skip to content

Commit

Permalink
fix method name and comment (#323)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZUOXIANGE authored Sep 23, 2024
1 parent ded6426 commit 86ba5d8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions samples/App3/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@
o.RefreshPeriod = TimeSpan.FromSeconds(60);
})
.AddConfigurationServiceEndpointProvider()
.AddNacosSrvServiceEndpointProvider();
.AddNacosServiceEndpointProvider();

builder.Services.ConfigureHttpClientDefaults(static http =>
{
http.AddServiceDiscovery();
});

// 使用IHttpClientFactory
// use IHttpClientFactory
builder.Services.AddHttpClient("app1", cfg =>
{
cfg.BaseAddress = new Uri("http://app1");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ namespace Microsoft.Extensions.Hosting;

public static class NacosServiceDiscoveryExtensions
{
public static IServiceCollection AddNacosSrvServiceEndpointProvider(this IServiceCollection services)
/// <summary>
/// Configures a service discovery endpoint provider which uses <see cref="T:Nacos.V2.INacosNamingService" /> to resolve endpoints.
/// </summary>
/// <param name="services">The service collection.</param>
/// <returns>The service collection.</returns>
public static IServiceCollection AddNacosServiceEndpointProvider(this IServiceCollection services)
{
ArgumentNullException.ThrowIfNull(services);

Expand Down
2 changes: 1 addition & 1 deletion src/Nacos.Microsoft.Extensions.ServiceDiscovery/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ builder.Services.AddServiceDiscovery(o =>
o.RefreshPeriod = TimeSpan.FromSeconds(60);
})
.AddConfigurationServiceEndpointProvider()
.AddNacosSrvServiceEndpointProvider();
.AddNacosServiceEndpointProvider();
```

## Links
Expand Down

0 comments on commit 86ba5d8

Please sign in to comment.