/// <summary> /// For internal use only. Adds the specified key and value to the serializer cache for the current thread during the serialization process. /// </summary> /// <param name="objKey">The the element to add as key.</param> /// <param name="objValue">The value of the element to add.</param> /// <remarks>The <see cref="ISurrogateWithReferenceId.ReferenceId"/> is updated for <see cref="objValue"/></remarks> public static void AddToCache(object objKey, ISurrogateWithReferenceId objValue) { _cache[Thread.CurrentThread.ManagedThreadId].AddToCache(objKey, objValue); }
/// <summary> /// For internal use only. Gets the object associated with the specified <see cref="ISurrogateWithReferenceId"/>. /// </summary> /// <param name="surrogateWithReferenceId">The <see cref="ISurrogateWithReferenceId"/> corresponding to the object to get.</param> /// <returns>The related object if presents, otherwise null.</returns> public static object GetCachedObject(ISurrogateWithReferenceId surrogateWithReferenceId) { return(_cache[Thread.CurrentThread.ManagedThreadId].GetCachedObject(surrogateWithReferenceId)); }