/// <summary> /// Ensures that an entry has a key. /// </summary> /// <param name="entry">The entry.</param> private void EnsureKey(ReadOnlyLazyEntry <TKey, TValue> entry) { if (entry.HasKey) { return; } entry.Key = _serializationService.ToObject <TKey>(entry.KeyData); }
/// <summary> /// Ensures that an entry has a value. /// </summary> /// <param name="entry">The entry.</param> private void EnsureValue(ReadOnlyLazyEntry <TValue> entry) { if (entry.HasValue) { return; } entry.Value = _serializationService.ToObject <TValue>(entry.ValueData); }
/// <summary> /// Ensures that a cache entry has a value. /// </summary> /// <param name="entry">The cache entry.</param> private void EnsureValue(ReadOnlyLazyEntry <TValue> entry) { if (entry.HasValue) { return; } // accepted race-condition here entry.Value = _serializationService.ToObject <TValue>(entry.ValueData); }