public override ReadOnlyDictionary <TKey, TValue> ConvertFromSurrogate(ref ReadOnlyDictionarySurrogate <TKey, TValue> surrogate) { if (surrogate.Values is null) { return(null); } else { return(new ReadOnlyDictionary <TKey, TValue>(surrogate.Values)); } }
public override void ConvertToSurrogate(ReadOnlyDictionary <TKey, TValue> value, ref ReadOnlyDictionarySurrogate <TKey, TValue> surrogate) { if (value is null) { surrogate = default; return; } else { surrogate = new ReadOnlyDictionarySurrogate <TKey, TValue> { Values = new Dictionary <TKey, TValue>(value) }; } }