public bool AddIfExists(GetNewValue <TValue> updateValueFunction) { lock (_lock) { if (!(_value is null)) { _value = updateValueFunction(_value); return(true); } return(false); } }
public bool UpdateIfExists(int key, GetNewValue <string> convertPreviousValueToNew) { var wrapper = _innerDictionary.GetOrAdd(key, _wrapperConstructor); return(wrapper.AddIfExists(convertPreviousValueToNew)); }