コード例 #1
0
 public object GetDeserializedObject(object obj, Type targetType)
 {
     if (_TypeCache.ContainsKey(targetType))
     {
         return(ImmutableListListConverter.ToImmutableMethod(targetType)(obj));
     }
     return(obj);
 }
コード例 #2
0
 public object GetObjectToSerialize(object obj, Type targetType)
 {
     if (targetType.IsGenericType && targetType.GetGenericTypeDefinition() == typeof(ImmutableList <>))
     {
         return(ImmutableListListConverter.ToListMethod(targetType)(obj));
     }
     return(obj);
 }