Ejemplo n.º 1
0
        public static JsonReadWriteDelegates GetGeneratedReadWriteDelegates(DataContract c)
        {
            // this method used to be rewritten by an IL transform
            // with the restructuring for multi-file, this is no longer true - instead
            // this has become a normal method
            JsonReadWriteDelegates result;

            return(JsonReadWriteDelegates.GetJsonDelegates().TryGetValue(c, out result) ? result : null);
        }
Ejemplo n.º 2
0
        public static JsonReadWriteDelegates GetGeneratedReadWriteDelegates(DataContract c)
        {
            // this method used to be rewritten by an IL transform
            // with the restructuring for multi-file, this is no longer true - instead
            // this has become a normal method
            JsonReadWriteDelegates result;

#if NET_NATIVE
            // The c passed in could be a clone which is different from the original key,
            // We'll need to get the original key data contract from generated assembly.
            DataContract keyDc = DataContract.GetDataContractFromGeneratedAssembly(c.UnderlyingType);
            return(JsonReadWriteDelegates.GetJsonDelegates().TryGetValue(keyDc, out result) ? result : null);
#else
            return(JsonReadWriteDelegates.GetJsonDelegates().TryGetValue(c, out result) ? result : null);
#endif
        }