Class ResilienceProperties
- Namespace
- Polly
- Assembly
- Polly.Core.dll
Represents a collection of custom resilience properties.
public sealed class ResilienceProperties
- Inheritance
-
ResilienceProperties
- Inherited Members
Methods
GetValue<TValue>(ResiliencePropertyKey<TValue>, TValue)
Gets the value of a given property with a fallback default value.
public TValue GetValue<TValue>(ResiliencePropertyKey<TValue> key, TValue defaultValue)
Parameters
keyResiliencePropertyKey<TValue>Strongly typed key to get the value of the property.
defaultValueTValueThe default value to use if property is not found.
Returns
- TValue
The property value or the default value.
Type Parameters
TValueThe type of property value as defined by
keyparameter.
Set<TValue>(ResiliencePropertyKey<TValue>, TValue)
Sets the value of a given property.
public void Set<TValue>(ResiliencePropertyKey<TValue> key, TValue value)
Parameters
keyResiliencePropertyKey<TValue>Strongly typed key to get the value of the property.
valueTValueReturns the value of the property.
Type Parameters
TValueThe type of property value as defined by
keyparameter.
TryGetValue<TValue>(ResiliencePropertyKey<TValue>, out TValue)
Gets the value of a given property.
public bool TryGetValue<TValue>(ResiliencePropertyKey<TValue> key, out TValue value)
Parameters
keyResiliencePropertyKey<TValue>Strongly typed key to get the value of the property.
valueTValueReturns the value of the property.
Returns
- bool
True, if a property was retrieved.
Type Parameters
TValueThe type of property value as defined by
keyparameter.