You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Methods TryGetValue and GetValue work incorrectly when the requested value is null. Specifically, TryGetValue returns false meaning it cannot find the key, and GetValue returns a value specified as a default value if the key was not found:
varkey=newResiliencePropertyKey<string?>("dummy");varprops=newResilienceProperties();props.Set(key,null);props.TryGetValue(key,outvarval)-->will return false, val will have null value though
props.GetValue(key,"default")-->will return a string "default", although the real value is null
Expected behavior
ResilienceProperties must return correct results even if a value being requested is null, in particular:
props.TryGetValue(key,outvarval)-->must return true and val must be null
props.GetValue(key,"default")-->must return null
Actual behavior
No response
Steps to reproduce
No response
Exception(s) (if any)
No response
Polly version
8.4.1
.NET Version
net6.0 net8.0
Anything else?
No response
The text was updated successfully, but these errors were encountered:
Describe the bug
Methods
TryGetValue
andGetValue
work incorrectly when the requested value is null. Specifically,TryGetValue
returnsfalse
meaning it cannot find the key, andGetValue
returns a value specified as a default value if the key was not found:Expected behavior
ResilienceProperties
must return correct results even if a value being requested is null, in particular:Actual behavior
No response
Steps to reproduce
No response
Exception(s) (if any)
No response
Polly version
8.4.1
.NET Version
net6.0 net8.0
Anything else?
No response
The text was updated successfully, but these errors were encountered: