Example #1
0
        internal static object?SurrogateToDataContractType(ISerializationSurrogateProvider serializationSurrogateProvider, object?oldObj, Type surrogatedDeclaredType, ref Type objType)
        {
            object?obj = DataContractSurrogateCaller.GetObjectToSerialize(serializationSurrogateProvider, oldObj, objType, surrogatedDeclaredType);

            if (obj != oldObj)
            {
                objType = obj != null?obj.GetType() : Globals.TypeOfObject;
            }
            return(obj);
        }
        internal static object SurrogateToDataContractType(IDataContractSurrogate dataContractSurrogate, object oldObj, Type surrogatedDeclaredType, ref Type objType)
        {
            object obj2 = DataContractSurrogateCaller.GetObjectToSerialize(dataContractSurrogate, oldObj, objType, surrogatedDeclaredType);

            if (obj2 != oldObj)
            {
                if (obj2 == null)
                {
                    objType = Globals.TypeOfObject;
                    return(obj2);
                }
                objType = obj2.GetType();
            }
            return(obj2);
        }