❔ Filter a ConcurrentDictionary
I have a
Currently, I'm using
Is there a better way to do this?
ConcurrentDictionary that I'm using for a small in-memory cache and I'm wondering what the best way to filter items out of it. one of the fields on the value stored in the dictionary is a DateTimeOffset expiration time and I'm still new to using it.Currently, I'm using
.Select() to filter out the expired items and casting it back to the Dict, overwriting the existing variable with a new one:Is there a better way to do this?