Closed talmroth closed 3 years ago
To do a contains, why not just do Get(key) != null
? (Or GerAsync).
That won’t work with value types and unfortunately I also have a use case where nulls are being cached so I need a definitive way to know if a value is cached.
Can this be switched to out T
instead of out object
if that's what is being returned here?
Can this be switched to
out T
instead ofout object
if that's what is being returned here?
Yes that would be better! Send a PR?
I actually need a Contains but since this version of MemoryCache does not have a Contains TryGetValue is the next best thing.