Skip to content

Commit 1a752d6

Browse files
author
Niel de Wet
committed
feat: update README.md
1 parent def391e commit 1a752d6

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

README.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@ This library removes the pain of coming up with your own storage structure and b
99

1010
## Usage
1111

12-
In order to use the *IOptions<HttpClientAppSettings>* to retrieve the stored endpoints the library must be added to the program
12+
In order to use the *IOptions<HttpClientAppSettings>* to retrieve the stored endpoints the library must be added to the program.
13+
14+
**validateSettings** is default true. It validates the endpoint values in the appSettings file.
1315

1416
```csharp
15-
builder.Services.AddHttpClientSettings(builder.Configuration);
17+
builder.Services.AddHttpClientSettings(builder.Configuration, validateSettings: true);
1618
```
1719

1820
In the appSettings.json file add a new section called **HttpClientSettings** with your endpoints grouped under a client. Please ensure each Client Name is unique as well as the endpoint name under each client.

example/HttpClientSettings.Example/Program.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
builder.Services.AddAutoMapper(Assembly.GetExecutingAssembly());
1717

18-
builder.Services.AddHttpClientSettings(builder.Configuration);
18+
builder.Services.AddHttpClientSettings(builder.Configuration, validateSettings: true);
1919

2020
builder.Services.AddScoped<IPokemonService, PokemonService>();
2121

0 commit comments

Comments
 (0)