Skip to content

Commit 086fa5f

Browse files
author
Noah Potash
committed
README fix attempt 2.
1 parent e27b3de commit 086fa5f

File tree

1 file changed

+21
-19
lines changed

1 file changed

+21
-19
lines changed

README.md

+21-19
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,32 @@ ConfigureAll is a library to make using the Options configuration pattern easier
99

1010
## How to use it
1111

12-
1. Implement the IConfigurationObject interface on your configuration objects by adding a ConfigurationKey property indicating the name of the key in your configuration that maps to this object
13-
```C#
14-
using SapientGuardian.ConfigureAll;
15-
16-
17-
namespace ConfigureAllTests
18-
{
19-
public class TestConfigurationObject : IConfigurationObject
12+
1. Implement the IConfigurationObject interface on your configuration objects by adding a ConfigurationKey property indicating the name of the key in your configuration that maps to this object
13+
```C#
14+
using SapientGuardian.ConfigureAll;
15+
16+
17+
namespace ConfigureAllTests
2018
{
21-
public string ConfigurationKey => "TestKey";
22-
23-
public string TestValue { get; set; }
19+
public class TestConfigurationObject : IConfigurationObject
20+
{
21+
public string ConfigurationKey => "TestKey";
22+
23+
public string TestValue { get; set; }
24+
}
2425
}
25-
}
26-
```
27-
2. Call ConfigureAll in your ConfigureServices method
28-
```C#
29-
public IConfiguration Configuration { get; }
26+
```
27+
2. Call ConfigureAll in your ConfigureServices method
28+
```C#
29+
using Microsoft.Extensions.Options;
30+
31+
public IConfiguration Configuration { get; }
3032

31-
public void ConfigureServices(IServiceCollection services)
33+
public void ConfigureServices(IServiceCollection services)
3234
{
3335
services.AddOptions();
3436

3537
services.ConfigureAll(this.GetType().GetTypeInfo().Assembly, Configuration);
3638
}
37-
```
38-
If your configuration objects are stored in a different assembly than the one containing your ConfigureServices method, be sure to specify that in the first parameter to ConfigureAll.
39+
```
40+
If your configuration objects are stored in a different assembly than the one containing your ConfigureServices method, be sure to specify that in the first parameter to ConfigureAll.

0 commit comments

Comments
 (0)