public object GetDeserializedObject(object obj, Type targetType) { if (_TypeCache.ContainsKey(targetType)) { return(ImmutableListListConverter.ToImmutableMethod(targetType)(obj)); } return(obj); }
public object GetObjectToSerialize(object obj, Type targetType) { if (targetType.IsGenericType && targetType.GetGenericTypeDefinition() == typeof(ImmutableList <>)) { return(ImmutableListListConverter.ToListMethod(targetType)(obj)); } return(obj); }