<PackageReference Include="Relativity.Server.Utility.SDK" Version="5000.0.0" />

LazyMemoryCache

public class LazyMemoryCache
Represents a singleton memory cache storing lazy values
public enum ExpirationType

Used to determine the cache expiration policy passed to the underlying MemoryCache.

public static LazyMemoryCache Instance { get; }

Gets the singleton instance of this LazyMemoryCache.

protected LazyMemoryCache()

Initializes a new instance of LazyMemoryCache.

public void Clear()

Clears the cache.

public object GetOrAdd(string key, object factoryData, Func<string, object, CancellationToken, object> valueFactory, Action<string, object, object, CacheEntryRemovedReason> removeCallback, TimeSpan expirationTimeSpan, ExpirationType expirationType, TimeSpan maxValueFactoryExecutionTime, int maxValueFactoryRetryAttempts = 1)

Retrieves an object from the cache with the given key.

public object GetOrAdd(string key, object factoryData, Func<string, object, CancellationToken, object> valueFactory, Action<string, object, object, CacheEntryRemovedReason> removeCallback, TimeSpan expirationTimeSpan, ExpirationType expirationType, TimeSpan maxValueFactoryExecutionTime, int maxValueFactoryRetryAttempts, bool waitForCompletionOnTimeout)

Retrieves an object from the cache with the given key.

public void Remove(string key)

Removes a cache entry from the cache.