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
key
ResiliencePropertyKey<TValue>Strongly typed key to get the value of the property.
defaultValue
TValueThe default value to use if property is not found.
Returns
- TValue
The property value or the default value.
Type Parameters
TValue
The type of property value as defined by
key
parameter.
Set<TValue>(ResiliencePropertyKey<TValue>, TValue)
Sets the value of a given property.
public void Set<TValue>(ResiliencePropertyKey<TValue> key, TValue value)
Parameters
key
ResiliencePropertyKey<TValue>Strongly typed key to get the value of the property.
value
TValueReturns the value of the property.
Type Parameters
TValue
The type of property value as defined by
key
parameter.
TryGetValue<TValue>(ResiliencePropertyKey<TValue>, out TValue)
Gets the value of a given property.
public bool TryGetValue<TValue>(ResiliencePropertyKey<TValue> key, out TValue value)
Parameters
key
ResiliencePropertyKey<TValue>Strongly typed key to get the value of the property.
value
TValueReturns the value of the property.
Returns
- bool
True, if a property was retrieved.
Type Parameters
TValue
The type of property value as defined by
key
parameter.