-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ResilienceStrategyRegistry now uses context to configure the builder
- Loading branch information
Showing
7 changed files
with
89 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
namespace Polly.Registry; | ||
|
||
/// <summary> | ||
/// The context used by <see cref="ResilienceStrategyRegistry{TKey}"/>. | ||
/// </summary> | ||
/// <typeparam name="TKey">The type of the key.</typeparam> | ||
public class ConfigureBuilderContext<TKey> | ||
where TKey : notnull | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="ConfigureBuilderContext{TKey}"/> class. | ||
/// </summary> | ||
/// <param name="strategyKey">The strategy key.</param> | ||
/// <param name="builderName">The builder name.</param> | ||
/// <param name="strategyKeyString">The strategy key as string.</param> | ||
public ConfigureBuilderContext(TKey strategyKey, string builderName, string strategyKeyString) | ||
{ | ||
StrategyKey = strategyKey; | ||
BuilderName = builderName; | ||
StrategyKeyString = strategyKeyString; | ||
} | ||
|
||
/// <summary> | ||
/// Gets the strategy key for the strategy being created. | ||
/// </summary> | ||
public TKey StrategyKey { get; } | ||
|
||
/// <summary> | ||
/// Gets the builder name for the builder being used to create the strategy. | ||
/// </summary> | ||
public string BuilderName { get; } | ||
|
||
/// <summary> | ||
/// Gets the string representation of strategy key for the strategy being created. | ||
/// </summary> | ||
public string StrategyKeyString { get; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 5 additions & 11 deletions
16
src/Polly.Extensions/DependencyInjection/AddResilienceStrategyContext.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters