Exemplo n.º 1
0
 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));
     }
 }
Exemplo n.º 2
0
 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)
         };
     }
 }