Skip to content

Commit a05fbd7

Browse files
committed
[fix] adding key perfix for GetChildKeys
1 parent 19a8c40 commit a05fbd7

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ appsettings.json
5858
var jsonConfig = new ConfigurationBuilder()
5959
.AddJsonFile("appsettings.json")
6060
.Build();
61-
61+
6262
var config = new ConfigurationBuilder()
6363
.AddEtcd(
6464
new Credentials("MyEtcdUserName", "passw"),

src/Etcd.Microsoft.Extensions.Configuration/EtcdConfigurationProvider.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ public EtcdConfigurationProvider(IEtcdKeyValueClient client, string? keyPrefix =
4848
/// </returns>
4949
public override bool TryGet(string key, out string value) => base.TryGet(_keyPrefix + key, out value);
5050

51+
/// <summary>Returns the list of keys that this provider has.</summary>
52+
/// <param name="earlierKeys">The earlier keys that other providers contain.</param>
53+
/// <param name="parentPath">The path for the parent IConfiguration.</param>
54+
/// <returns>The list of keys for this provider.</returns>
55+
public override IEnumerable<string> GetChildKeys(IEnumerable<string> earlierKeys, string parentPath) => base.GetChildKeys(earlierKeys, _keyPrefix + parentPath);
56+
5157
/// <summary>
5258
/// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
5359
/// </summary>

0 commit comments

Comments
 (0)