Replies: 1 comment 1 reply
-
Hi @sebbarg
Not really: by saying
So by forcing a Otherwise you would not be able to differentiate between "I'm receiving null because null is in the cache" and "I'm receiving null because there is nothing in the cache". You are thinking about
Yes exactly, because here you are saying "give me the value or, if not there, the default value of the type". But I'll add that if you don't care to know IF the value is in the cache or not, you can just call Hope this helps, let me know. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Nitpick: violation of Principle of Least Surprise in operator overload
=
?Given an empty cache, this throws an exception ("A value is not available for this instance") on line 2:
I would expect it to assign
null
to poco.This works as expected, so I guess that is the way to go?
Beta Was this translation helpful? Give feedback.
All reactions